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.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index ae6b725b3665..fe752fdb26c3 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1546,13 +1546,26 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1546 } else 1546 } else
1547 goto cifs_setattr_exit; 1547 goto cifs_setattr_exit;
1548 } 1548 }
1549 if (attrs->ia_valid & ATTR_UID) { 1549
1550 cFYI(1, ("UID changed to %d", attrs->ia_uid)); 1550 /*
1551 uid = attrs->ia_uid; 1551 * Without unix extensions we can't send ownership changes to the
1552 } 1552 * server, so silently ignore them. This is consistent with how
1553 if (attrs->ia_valid & ATTR_GID) { 1553 * local DOS/Windows filesystems behave (VFAT, NTFS, etc). With
1554 cFYI(1, ("GID changed to %d", attrs->ia_gid)); 1554 * CIFSACL support + proper Windows to Unix idmapping, we may be
1555 gid = attrs->ia_gid; 1555 * able to support this in the future.
1556 */
1557 if (!pTcon->unix_ext &&
1558 !(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID)) {
1559 attrs->ia_valid &= ~(ATTR_UID | ATTR_GID);
1560 } else {
1561 if (attrs->ia_valid & ATTR_UID) {
1562 cFYI(1, ("UID changed to %d", attrs->ia_uid));
1563 uid = attrs->ia_uid;
1564 }
1565 if (attrs->ia_valid & ATTR_GID) {
1566 cFYI(1, ("GID changed to %d", attrs->ia_gid));
1567 gid = attrs->ia_gid;
1568 }
1556 } 1569 }
1557 1570
1558 time_buf.Attributes = 0; 1571 time_buf.Attributes = 0;