Hi Dan,
On Oct 7, 2009, at 9:24 AM, Dan Kegel wrote:
Yeah, the patch handles OS X [...]
Tangentially related to this xattr issue, are you aware of BSD's chflags system call and the st_flags field of struct stat? On Mac OS X (and any other BSD which defines UF_HIDDEN), FILE_ATTRIBUTE_HIDDEN is better implemented by checking for UF_HIDDEN in the st_flags field. This will then actually integrate with the native API's and GUI's notion of hidden files.
Similarly, FILE_ATTRIBUTE_ARCHIVE corresponds to the _lack_ of UF_NODUMP and SF_ARCHIVED. (We should check the SF_ flag, but we can only expect to be able to set/clear the UF_ flag.)
It would also be good to check for UF_IMMUTABLE|SF_IMMUTABLE to determine FILE_ATTRIBUTE_READONLY, and set UF_IMMUTABLE when setting FILE_ATTRIBUTE_READONLY, although that's a bit of a digression from what you're directly working on in your patches.
The version of Samba for Mac OS X is patched to work with these flags:
http://www.opensource.apple.com/source/samba/samba-235/patches/support-stfla... http://www.opensource.apple.com/source/samba/samba-235/patches/support-stfla...
Regards, Ken