Stream names with colon don't work with fruit:encoding = native =============================================================== OS X makes extensive use of colons (':') in xattr names. On SMB mounts with streams support, xattrs are mapped to named streams and the client maps the colon character (as any other illegal NTFS character) to the Unicode private range. This means by default on a Samba share with vfs_streams_xattr, the stream is again mapped to a xattr and the colon in the xattr name is stored as an UTF8 encoded Unicode private range character. So far things work correct. :) Example: samba$ $ grep -A 3 '\[AAPL' /opt/samba/etc/smb.conf [AAPL] path = /Volumes/aapl vfs objects = catia fruit streams_xattr # fruit:encoding = native mac$ mount_smbfs -o nobrowse //fedora20.local/aapl mnt mac$ touch mnt/file mac$ xattr -w 'foo:bar' baz mnt/file mac$ xattr -l mnt/file foo:bar: baz mac$ samba$ getfattr /Volumes/aapl/file getfattr: Removing leading '/' from absolute path names # file: Volumes/aapl/file user.DOSATTRIB user.DosStream.foobar:$DATA vfs_fruit can enable a builtin vfs_catia mapping (requires vfs_catia to be loaded of course) that maps the illegal NTFS characters between their mapped private range and the native ASCII representation. This applies both to filenames as well as xattr names, examples: samba$ $ grep -A 3 '\[AAPL' /opt/samba/etc/smb.conf [AAPL] path = /Volumes/aapl vfs objects = catia fruit streams_xattr fruit:encoding = native mac$ mount_smbfs -o nobrowse //fedora20.local/aapl mnt mac$ touch mnt/file mac$ xattr -w 'foo:bar' baz mnt/file mac$ xattr -l mnt/file foo:bar: baz mac$ samba$ getfattr /Volumes/aapl/file getfattr: Removing leading '/' from absolute path names # file: Volumes/aapl/file user.DOSATTRIB user.DosStream.foo:bar:$DATA We have two issues with this: - we don't perform the reverse mapping from native ASCII to the private range when enumerating streams in getinfo calls - vfs_streams_xattr uses strchr_m(':') instead of strrchr_m(':') at one point when looking for the streamname:streamtype seperator which won't work if the streamname contains a colon Patches including a torture test are pending.
Created attachment 11305 [details] Patch for master Patch for testing, fixes the issue for me.
*** Bug 11162 has been marked as a duplicate of this bug. ***
Created attachment 11316 [details] Patchset that is supposed to go into master
Created attachment 11325 [details] Patch for 4.3 cherry-picked from master
Created attachment 11326 [details] Patch for 4.2 cherry-picked from master
Pushed to autobuild-v4-3-test, doesn't apply to v4-2-test
(In reply to Stefan Metzmacher from comment #6) Doesn't apply to 4-2 because it needs the changes from the copyfile patch you just pushed in bug 113167. Please try again once the copyfile patchset is in 4-2, thanks!
Pushed to autobuild-v4-2-test
Pushed to v4-{2,3}-test