vfs_streams_xattr: stream name prefix and type suffix

Christof Schmitt cs at samba.org
Tue May 27 15:41:37 MDT 2014


On Fri, May 23, 2014 at 06:52:05PM +0200, Volker Lendecke wrote:
> On Wed, May 21, 2014 at 01:47:53PM +0200, Ralph Böhme wrote:
> > With the patches applied, adding the following to smb.conf
> > 
> >       streams_xattr:prefix = user.
> >       streams_xattr:store_stream_type = no
> > 
> > gives the desired behaviour.
> > 
> > Thoughts?
> 
> The idea sounds good.

source3/smbd/trans2.c

has this function that relies on the user.DosStream prefix to determine
which xattrs to exclude from extended attributes returned to the client:

static bool samba_private_attr_name(const char *unix_ea_name)
{
        static const char * const prohibited_ea_names[] = {
                SAMBA_POSIX_INHERITANCE_EA_NAME,
                SAMBA_XATTR_DOS_ATTRIB,
                SAMBA_XATTR_MARKER,
                XATTR_NTACL_NAME,
                NULL
        };

        int i;

        for (i = 0; prohibited_ea_names[i]; i++) {
                if (strequal( prohibited_ea_names[i], unix_ea_name))
                        return true;
        }
        if (strncasecmp_m(unix_ea_name, SAMBA_XATTR_DOSSTREAM_PREFIX,
                        strlen(SAMBA_XATTR_DOSSTREAM_PREFIX)) == 0) {
                return true;
        }
        return false;
}

Changing the prefix only for streams_xattr would make these attributes
also visible to clients connecting to Samba. Maybe that is not a big
issue, but we should be at least aware of it and put it in the
documentation (manpage?).

Christof


More information about the samba-technical mailing list