Explorar o código

[CIFS] Do not send Query All EAs SMB when mount option nouser_xattr
specified

Pointed out by Bjoern Jacke

Signed-off-by: Steve French <sfrench@us.ibm.com>

Steve French %!s(int64=19) %!d(string=hai) anos
pai
achega
ea4c07d780
Modificáronse 3 ficheiros con 8 adicións e 3 borrados
  1. 2 1
      fs/cifs/CHANGES
  2. 1 1
      fs/cifs/README
  3. 5 1
      fs/cifs/xattr.c

+ 2 - 1
fs/cifs/CHANGES

@@ -5,7 +5,8 @@ time out requests if server still responding reasonably fast
 on requests on other threads.  Improve POSIX locking emulation,
 on requests on other threads.  Improve POSIX locking emulation,
 (lock cancel now works, and unlock of merged range works even
 (lock cancel now works, and unlock of merged range works even
 to Windows servers now).  Fix oops on mount to lanman servers
 to Windows servers now).  Fix oops on mount to lanman servers
-(win9x, os/2 etc.) when null password.
+(win9x, os/2 etc.) when null password.  Do not send listxattr
+(SMB to query all EAs) if nouser_xattr specified.
 
 
 Version 1.44
 Version 1.44
 ------------
 ------------

+ 1 - 1
fs/cifs/README

@@ -408,7 +408,7 @@ A partial list of the supported mount options follows:
   user_xattr    Allow getting and setting user xattrs as OS/2 EAs (extended
   user_xattr    Allow getting and setting user xattrs as OS/2 EAs (extended
 		attributes) to the server (default) e.g. via setfattr 
 		attributes) to the server (default) e.g. via setfattr 
 		and getfattr utilities. 
 		and getfattr utilities. 
-  nouser_xattr  Do not allow getfattr/setfattr to get/set xattrs 
+  nouser_xattr  Do not allow getfattr/setfattr to get/set/list xattrs 
   mapchars      Translate six of the seven reserved characters (not backslash)
   mapchars      Translate six of the seven reserved characters (not backslash)
 			*?<>|:
 			*?<>|:
 		to the remap range (above 0xF000), which also
 		to the remap range (above 0xF000), which also

+ 5 - 1
fs/cifs/xattr.c

@@ -330,11 +330,15 @@ ssize_t cifs_listxattr(struct dentry * direntry, char * data, size_t buf_size)
 	sb = direntry->d_inode->i_sb;
 	sb = direntry->d_inode->i_sb;
 	if(sb == NULL)
 	if(sb == NULL)
 		return -EIO;
 		return -EIO;
-	xid = GetXid();
 
 
 	cifs_sb = CIFS_SB(sb);
 	cifs_sb = CIFS_SB(sb);
 	pTcon = cifs_sb->tcon;
 	pTcon = cifs_sb->tcon;
 
 
+	if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
+		return -EOPNOTSUPP;
+
+	xid = GetXid();
+
 	full_path = build_path_from_dentry(direntry);
 	full_path = build_path_from_dentry(direntry);
 	if(full_path == NULL) {
 	if(full_path == NULL) {
 		FreeXid(xid);
 		FreeXid(xid);