2

I have a samba server and a mix of Mac and Windows clients. On those clients I have an application that require to know the full path of files on the samba server. For the samba server, we are using vfs_fruit and vfs_streams_xattr which can handle extended attributes.

I am wondering if it is possible to somehow put the real path of a file on the samba server as an extended attribute and let the clients read that extended attribute.

I have tried implementing this by changing the source code for samba but to no avail. Some help would be appreciated.

1 Answer 1

1

Not sure why you'd want to do that but you could store the server full path of the files in a "NTFS alternate data stream" that would then be readable by the Samba clients. Samba "fakes" NTFS alternate data streams by storing them as extended attributes.

Your data would be just the path so streams_xattr would be OK. The extended attribute needs to be called user.DosStream."ADS-NAME" as seen at https://www.samba.org/samba/docs/man/manpages/vfs_streams_xattr.8.html

Writing a script to periodically add the attribute to existing files with setfattr would be easy enough.

To create it "real time" would be more complicated but modifying the source code of Samba is not needed, you just need to run a script to create / modify the extended attribute when the files are created / moved. Have a look at incron for that, there's an example on https://stackoverflow.com/questions/14692353/executing-a-bash-script-upon-file-creation

1
  • thanks for the reply; the problem we have now is how to actually read these extended attributes from the mac/osx client; when we do a xattr on the client, those extended attributes are not showing up
    – Brexiteer
    Commented Dec 9, 2016 at 0:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .