VFS change needed for 4.1.0 and above.

Jeremy Allison jra at samba.org
Wed May 15 11:26:57 MDT 2013


On Fri, May 10, 2013 at 08:47:30PM -0700, Jeremy Allison wrote:
> In working with Steve French to define POSIX extended
> attribute support in Samba I've realized I'm going to have
> to add the following 4 functions to the Samba VFS (in
> master, i.e. 4.1.0).
> 
> lgetxattr
> lsetxattr
> lremovexattr
> llistxattr
> 
> Damn. This is my fault for not adding them in the
> first place :-(. I remember thinking about it but
> not doing so as we weren't using them and I didn't
> want to add non-used functions to the VFS definition.
> 
> This will definitely be a Samba 4.1.0 and above
> server change. I'll try and work this out next
> week whilst at SambaXP.
> 
> The good news is it will help me finally remove
> the broken semantics of dos_filemode (long story
> with a unsubmitted patch).

So I did a *lot* of digging into this at SambaXP
(between talks :-).

It turns out that Linux *can* set EA's on symlinks,
but they have to be in the security. namespace,
not the user. namespace (which means it's a root-only
operation).

To see this look at the man page for setfattr/getfattr
and note the '-h' option that makes the utility use
the l varients of the set/get/list/remove EA calls.

So to correctly allow remoting of EA calls from
a UNIX extensions client we are going to need
to add

lgetxattr
lsetxattr
lremovexattr
llistxattr

into our VFS for 4.1.x.

Amusingly enough look for

smb_vfs_call_lsetxattr()
smb_vfs_call_llistxattr()

which still remaining as ghosts in the vfs.h file :-).

Cheers,

	Jeremy.


More information about the samba-technical mailing list