|
@@ -208,7 +208,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
|
|
/* If Open reported that we actually created a file
|
|
/* If Open reported that we actually created a file
|
|
then we now have to set the mode if possible */
|
|
then we now have to set the mode if possible */
|
|
if ((cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
|
|
if ((cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
|
|
- (oplock & CIFS_CREATE_ACTION))
|
|
|
|
|
|
+ (oplock & CIFS_CREATE_ACTION)) {
|
|
|
|
+ mode &= ~current->fs->umask;
|
|
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
|
|
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
|
|
CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
|
|
CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
|
|
(__u64)current->fsuid,
|
|
(__u64)current->fsuid,
|
|
@@ -226,7 +227,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
|
|
cifs_sb->mnt_cifs_flags &
|
|
cifs_sb->mnt_cifs_flags &
|
|
CIFS_MOUNT_MAP_SPECIAL_CHR);
|
|
CIFS_MOUNT_MAP_SPECIAL_CHR);
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
/* BB implement mode setting via Windows security
|
|
/* BB implement mode setting via Windows security
|
|
descriptors e.g. */
|
|
descriptors e.g. */
|
|
/* CIFSSMBWinSetPerms(xid,pTcon,path,mode,-1,-1,nls);*/
|
|
/* CIFSSMBWinSetPerms(xid,pTcon,path,mode,-1,-1,nls);*/
|
|
@@ -336,6 +337,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
|
|
if (full_path == NULL)
|
|
if (full_path == NULL)
|
|
rc = -ENOMEM;
|
|
rc = -ENOMEM;
|
|
else if (pTcon->ses->capabilities & CAP_UNIX) {
|
|
else if (pTcon->ses->capabilities & CAP_UNIX) {
|
|
|
|
+ mode &= ~current->fs->umask;
|
|
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
|
|
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
|
|
rc = CIFSSMBUnixSetPerms(xid, pTcon, full_path,
|
|
rc = CIFSSMBUnixSetPerms(xid, pTcon, full_path,
|
|
mode, (__u64)current->fsuid,
|
|
mode, (__u64)current->fsuid,
|