Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszer...
[sfrench/cifs-2.6.git] / fs / xattr.c
index d7c2cf7817bbe000a28171ec2935efcc5ca66c9a..4424f7fecf14549b65c62d0cac4b8b692718f426 100644 (file)
@@ -442,6 +442,12 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
                if ((strcmp(kname, XATTR_NAME_POSIX_ACL_ACCESS) == 0) ||
                    (strcmp(kname, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
                        posix_acl_fix_xattr_from_user(kvalue, size);
+               else if (strcmp(kname, XATTR_NAME_CAPS) == 0) {
+                       error = cap_convert_nscap(d, &kvalue, size);
+                       if (error < 0)
+                               goto out;
+                       size = error;
+               }
        }
 
        error = vfs_setxattr(d, kname, kvalue, size, flags);