aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c54
1 files changed, 32 insertions, 22 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 0e5dccc2f79a..024846719f1f 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -986,23 +986,24 @@ mkdir_get_info:
986 direntry->d_inode->i_nlink = 2; 986 direntry->d_inode->i_nlink = 2;
987 mode &= ~current->fs->umask; 987 mode &= ~current->fs->umask;
988 if (pTcon->unix_ext) { 988 if (pTcon->unix_ext) {
989 struct cifs_unix_set_info_args args = {
990 .mode = mode,
991 .ctime = NO_CHANGE_64,
992 .atime = NO_CHANGE_64,
993 .mtime = NO_CHANGE_64,
994 .device = 0,
995 };
989 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { 996 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
990 CIFSSMBUnixSetPerms(xid, pTcon, full_path, 997 args.uid = (__u64)current->fsuid;
991 mode, 998 args.gid = (__u64)current->fsgid;
992 (__u64)current->fsuid,
993 (__u64)current->fsgid,
994 0 /* dev_t */,
995 cifs_sb->local_nls,
996 cifs_sb->mnt_cifs_flags &
997 CIFS_MOUNT_MAP_SPECIAL_CHR);
998 } else { 999 } else {
999 CIFSSMBUnixSetPerms(xid, pTcon, full_path, 1000 args.uid = NO_CHANGE_64;
1000 mode, (__u64)-1, 1001 args.gid = NO_CHANGE_64;
1001 (__u64)-1, 0 /* dev_t */,
1002 cifs_sb->local_nls,
1003 cifs_sb->mnt_cifs_flags &
1004 CIFS_MOUNT_MAP_SPECIAL_CHR);
1005 } 1002 }
1003 CIFSSMBUnixSetInfo(xid, pTcon, full_path, &args,
1004 cifs_sb->local_nls,
1005 cifs_sb->mnt_cifs_flags &
1006 CIFS_MOUNT_MAP_SPECIAL_CHR);
1006 } else { 1007 } else {
1007 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) && 1008 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) &&
1008 (mode & S_IWUGO) == 0) { 1009 (mode & S_IWUGO) == 0) {
@@ -1500,9 +1501,9 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1500 FILE_BASIC_INFO time_buf; 1501 FILE_BASIC_INFO time_buf;
1501 bool set_time = false; 1502 bool set_time = false;
1502 bool set_dosattr = false; 1503 bool set_dosattr = false;
1503 __u64 mode = 0xFFFFFFFFFFFFFFFFULL; 1504 __u64 mode = NO_CHANGE_64;
1504 __u64 uid = 0xFFFFFFFFFFFFFFFFULL; 1505 __u64 uid = NO_CHANGE_64;
1505 __u64 gid = 0xFFFFFFFFFFFFFFFFULL; 1506 __u64 gid = NO_CHANGE_64;
1506 struct cifsInodeInfo *cifsInode; 1507 struct cifsInodeInfo *cifsInode;
1507 struct inode *inode = direntry->d_inode; 1508 struct inode *inode = direntry->d_inode;
1508 1509
@@ -1586,12 +1587,21 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1586 } 1587 }
1587 1588
1588 if ((pTcon->unix_ext) 1589 if ((pTcon->unix_ext)
1589 && (attrs->ia_valid & (ATTR_MODE | ATTR_GID | ATTR_UID))) 1590 && (attrs->ia_valid & (ATTR_MODE | ATTR_GID | ATTR_UID))) {
1590 rc = CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode, uid, gid, 1591 struct cifs_unix_set_info_args args = {
1591 0 /* dev_t */, cifs_sb->local_nls, 1592 .mode = mode,
1592 cifs_sb->mnt_cifs_flags & 1593 .uid = uid,
1594 .gid = gid,
1595 .ctime = NO_CHANGE_64,
1596 .atime = NO_CHANGE_64,
1597 .mtime = NO_CHANGE_64,
1598 .device = 0,
1599 };
1600 rc = CIFSSMBUnixSetInfo(xid, pTcon, full_path, &args,
1601 cifs_sb->local_nls,
1602 cifs_sb->mnt_cifs_flags &
1593 CIFS_MOUNT_MAP_SPECIAL_CHR); 1603 CIFS_MOUNT_MAP_SPECIAL_CHR);
1594 else if (attrs->ia_valid & ATTR_MODE) { 1604 } else if (attrs->ia_valid & ATTR_MODE) {
1595 rc = 0; 1605 rc = 0;
1596#ifdef CONFIG_CIFS_EXPERIMENTAL 1606#ifdef CONFIG_CIFS_EXPERIMENTAL
1597 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) 1607 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)