On systems without xattr support (such as OpenBSD), the setxattr() wrapper returns ENOSYS, which is mapped to NT_STATUS_NOT_SUPPORTED. dosmode() and file_set_dosmode() fall back to using unix modes on NT_STATUS_NOT_IMPLEMENTED, but not NT_STATUS_NOT_SUPPORTED, so these functions fail rather than falling back as intended. I noticed this because subversion tries to hide its .svn directories, so until I set 'store dos attributes = no' in smb.conf, svn didn't work on Windows clients connected to an OpenBSD samba server. I'm not sure if there's an important difference between NT_STATUS_NOT_SUPPORTED and NT_STATUS_NOT_IMPLEMENTED, so I can't say whether it'd be better to change the mapping of ENOSYS or apply the fallback on either error code.
Even on Linux there's no fallback iirc. You have to explicitly disable "store dos attributes" if your filesystem doesn't support xattrs.
Have I misunderstood the purpose of this block? https://git.samba.org/?p=samba.git;a=blob;f=source3/smbd/dosmode.c;h=38d34623336ed1285830572cacaea2e01ef6797a;hb=HEAD#l995 That seems like what it's there to do.
Yes, see https://git.samba.org/?p=samba.git;a=blob;f=source3/smbd/dosmode.c;h=38d34623336ed1285830572cacaea2e01ef6797a;hb=HEAD#l400 and https://git.samba.org/?p=samba.git;a=blob;f=source3/smbd/dosmode.c;h=38d34623336ed1285830572cacaea2e01ef6797a;hb=HEAD#l478
Sure, I can see how that part of it works. It just seems to me that it could also cover the case where there's no xattr support available at all, and I don't see anything there to indicate why it shouldn't. To me, the current situation seems a bit less helpful to the samba administrator than it could be.
(In reply to Jonathan Matthew from comment #4) We understand, we just found that silent fallbacks bite, they work pretty well so nobody noticed until they hit an edge case. So we prefer to fail clearly, and ensure that a clear statement has to be put in the smb.conf (which might encourage the administrator to instead ensure xattrs are available). Now I realise that an administrator deploying exclusively on OpenBSD does not have that option, but here it still remains helpful (compared with a flipped default or 'auto') because when posting the smb.conf to the mailing list, it will be clear that 'store dos attributes = no' has been set to those aiding in debugging. Sorry!