|
@@ -112,6 +112,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
|
|
struct cifsTconInfo *pTcon;
|
|
struct cifsTconInfo *pTcon;
|
|
struct super_block *sb;
|
|
struct super_block *sb;
|
|
char *full_path;
|
|
char *full_path;
|
|
|
|
+ struct cifs_ntsd *pacl;
|
|
|
|
|
|
if (direntry == NULL)
|
|
if (direntry == NULL)
|
|
return -EIO;
|
|
return -EIO;
|
|
@@ -166,6 +167,25 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
|
|
rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
|
|
rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
|
|
(__u16)value_size, cifs_sb->local_nls,
|
|
(__u16)value_size, cifs_sb->local_nls,
|
|
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
|
|
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
|
|
|
|
+ } else if (strncmp(ea_name, CIFS_XATTR_CIFS_ACL,
|
|
|
|
+ strlen(CIFS_XATTR_CIFS_ACL)) == 0) {
|
|
|
|
+ pacl = kmalloc(value_size, GFP_KERNEL);
|
|
|
|
+ if (!pacl) {
|
|
|
|
+ cFYI(1, "%s: Can't allocate memory for ACL",
|
|
|
|
+ __func__);
|
|
|
|
+ rc = -ENOMEM;
|
|
|
|
+ } else {
|
|
|
|
+#ifdef CONFIG_CIFS_ACL
|
|
|
|
+ memcpy(pacl, ea_value, value_size);
|
|
|
|
+ rc = set_cifs_acl(pacl, value_size,
|
|
|
|
+ direntry->d_inode, full_path);
|
|
|
|
+ if (rc == 0) /* force revalidate of the inode */
|
|
|
|
+ CIFS_I(direntry->d_inode)->time = 0;
|
|
|
|
+ kfree(pacl);
|
|
|
|
+#else
|
|
|
|
+ cFYI(1, "Set CIFS ACL not supported yet");
|
|
|
|
+#endif /* CONFIG_CIFS_ACL */
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
int temp;
|
|
int temp;
|
|
temp = strncmp(ea_name, POSIX_ACL_XATTR_ACCESS,
|
|
temp = strncmp(ea_name, POSIX_ACL_XATTR_ACCESS,
|