Bug 11504 - vfs_fruit OS X client unable to create xattr
vfs_fruit OS X client unable to create xattr
Status: ASSIGNED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules
4.2.3
All Mac OS X
: P3 major
: ---
Assigned To: Ralph Böhme
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-09 11:55 UTC by Michal Moravec
Modified: 2016-07-18 16:11 UTC (History)
1 user (show)

See Also:


Attachments
Level 10 debug log (1.50 MB, application/zip)
2015-09-09 11:55 UTC, Michal Moravec
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Moravec 2015-09-09 11:55:37 UTC
Created attachment 11421 [details]
Level 10 debug log

This bug report is followup to mailing list conversation: "[Samba] vfs fruit unable to create xattr and ACL from OS X 10.10.4"

When we turn on vfs_fruit module with default configuration, OS X clients are unable to create xattr with exception of ResourceFork and FinderInfo which are handled by vfs_fruit in different way.

Server setup:
Gentoo Linux
Samba 4.2.3
Users in Active Directory
We were able to replicate this problem in 3 diffent AD,Samba enviroments. They have shares on different filesystems.
Production - EXT4 filesystem
Testing & Development - Btrfs filesystem

Fruit config (everything left to default):
vfs objects = catia fruit streams_xattr

Client setup:
OS X 10.10.5 with Apple SMBX

Steps to replicate:

[Fruit is OFF]
-> mount samba share on OS X client

>> mkdir nofruit_dir
>> touch nofruit_file
>> xattr -w jmeno data nofruit_dir
>> xattr -l nofruit_file
jmeno: data
>> xattr -w jmeno data nofruit_file
>> xattr -l nofruit_dir
jmeno: data
>> ls -la@
-rwx------@ 1 michal  staff   6148 Sep  9 12:03 .DS_Store
	com.apple.FinderInfo	   32 
-rwx------  1 michal  staff   4096 Sep  9 12:03 ._.DS_Store
-rwx------  1 michal  staff   4096 Sep  9 12:05 ._nofruit_dir
-rwx------  1 michal  staff   4096 Sep  9 12:05 ._nofruit_file
drwx------@ 1 michal  staff  16384 Sep  9 12:04 nofruit_dir/
	jmeno	    4 
-rwx------@ 1 michal  staff      0 Sep  9 12:03 nofruit_file
	jmeno	    4 

-> umount samba share
[with bare Samba we are able to create xattr. Attributes are saved to AppleDouble files as expected]
-> TURN vfs_fruit ON
-> TURN ON level 10 debug logging

[Fruit is ON]

-> mount samba share on OS X client
>> cd /Volumes/apple
>> touch fruit_bug_file
>> xattr -w testxattr testdata fruit_bug_file
>> xattr -l fruit_bug_file
>> ls -l@ fruit_bug_file
  - -rw-rwxr--  1 michal  staff  0 Sep  9 12:17 fruit_bug_file
>> mkdir fruit_bug_dir
>> xattr -w testxattr testdata fruit_bug_dir 
>> xattr -l fruit_bug_dir
>> ls -ld@ fruit_bug_dir
  - drwxrwxr-x  1 michal  staff  16384 Sep  9 12:20 fruit_bug_dir/
>> ls -la@                       
total 82
drwx------  1 michal  staff  16384 Sep  9 12:09 ./
drwxrwxrwt@ 7 root    admin    238 Sep  9 12:09 ../
	com.apple.FinderInfo	   32 
-rwxrwx---@ 1 michal  staff   6148 Sep  9 12:03 .DS_Store
	com.apple.FinderInfo	   32 
	com.apple.ResourceFork	  286 
drwxrwxr-x  1 michal  staff  16384 Sep  9 12:20 fruit_bug_dir/
-rw-rwxr--  1 michal  staff  0     Sep  9 12:17 fruit_bug_file
drwxrwx---@ 1 michal  staff  16384 Sep  9 12:04 nofruit_dir/
	com.apple.ResourceFork	  286 
-rwxrwx---@ 1 michal  staff      0 Sep  9 12:03 nofruit_file
	com.apple.ResourceFork	  286 
-rwxrwx---@ 1 michal  staff      0 Sep  9 12:08 test
	com.apple.ResourceFork	  286 
-> umount samba share
[with vfs_fruit module we are NOT able to create xattr]

Note com.apple.ResourceFork on nofruit_dir and nofruit_file. Where did it come from?
Comment 1 Richard Baker 2015-09-18 13:50:46 UTC
Not sure if this is related (or helps):

Client: Mac OS X 10.10.5
Server: Samba 4.3.0 server on Debian 6.0

If I created a file on the local client system and gave it an attribute with xattr,
then copied that file to the samba share, then as noted there appeared to be no attributes
set on the file on the samba share. However if I looked at the file on the server with 
getfattr the attributes were set (with the user.DosStream prefix). So it appears on 
my server that the attributes are set but not shown when doing a ls -l@ from the client.


Original file:

$ ls -al@ test.txt 
-rw-r--r--@ 1 rtbaker  staff  21 17 Sep 11:09 test.txt
	Type	 9 
	user.test	 5 


File as seen on the client after copying to the share:

$ ls -al@ test.txt 
-rwx------  1 rtbaker  staff  21 17 Sep 12:57 test.txt 


File as seen on the server:

# getfattr test.txt 
# file: test.txt
user.DosStream.Type:$DATA
user.DosStream.user.test:$DATA

cheers

Richard 


# -----------------------------------------------------------------------------------------
Samba config for that share:

[homes]
   comment = Home Directories
   browseable = yes
   vfs objects = catia fruit streams_xattr
   fruit:resource = xattr
   fruit:metadata = stream
   fruit:locking = none
   fruit:encoding = native
Comment 2 Ralph Böhme 2016-07-18 16:10:56 UTC
Do you have "store dos attributes = yes" in smb.conf? This requirement is now also mentioned in an updated version of man vfs_fruit.
Comment 3 Ralph Böhme 2016-07-18 16:11:35 UTC
(In reply to Richard Baker from comment #1)
"fruit:resource = xattr" only works on Solaris and derivates with ZFS.