[PATCH RFC] s3: smbd: Consistently map EAs to user namespace

Andrew Bartlett abartlet at samba.org
Tue Sep 27 21:37:41 UTC 2022


I honestly can't think of a way out of this that doesn't break
something. 

Mapping the EAs from multiple namespaces by stripping the prefix really
seems to be a bad idea - if only because information is lost.

Also, I just don't see what business a windows client would have in
reading the non-user EAs, and if a client should read them they should
be read in their own namespace. 

Andrew

On Tue, 2022-09-27 at 22:10 +0200, Daniel Kobras via samba-technical
wrote:
> Hi all!
> 
> 
> The attached patch restricts the extended attributes that Samba
> exposes
> to clients as Windows EAs to the 'user' namespace in the local
> filesystem. This is a potentially user-visible change, and Jeremy
> suggested I put this up here for comments and discussion first.
> 
> Gory details can be found in a recent thread on the samba list[0],
> and
> the related bug report[1], quick summary here:
> 
> Samba maps all Windows EA to EA names below the 'user' namespace in
> the
> local filesystem, but in the opposite direction, it exposes all EA
> namespaces (except 'system' and some EAs reserved for internal use)
> to
> Windows EAs. The 'user.' prefix is stripped, all other names are
> passed
> verbatim. For EAs outside the 'user' namespace, this leads to
> potential
> collisions ('foo.bar' and 'user.foo.bar' map to the same Windows EA),
> and renames those EAs if a file is copied via Samba ('foo.bar' on the
> original file becomes 'user.foo.bar' in the clone). The latter may
> lead
> to subtle and misleading errors if the 'user' EA namespace is
> disabled
> (mount option 'user_xattr' not set).
> 
> The issues can be avoided with a consistent mapping between Windows
> EAs
> and the 'user' namespace in both directions, ie. no longer present
> EAs
> outside of 'user' as Windows EAs in SMB_INFO_QUERY_ALL_EAS and
> friends.
> Do you agree with this approach? Are there applications that rely on
> the current mapping of non-user EAs? Please let me know if I should
> submit the patch as a proper MR.
> 
> Kind regards,
> 
> Daniel
> 
> [0] 
> https://lists.samba.org/archive/samba/2022-September/241918.html
> 
> [1] 
> https://bugzilla.samba.org/show_bug.cgi?id=15186
> 
> -- 
> Daniel Kobras
> Principal Architect
> Puzzle ITC Deutschland
> +49 7071 14316 0
> www.puzzle-itc.de
> 
-- 
Andrew Bartlett (he/him)       https://samba.org/~abartlet/
Samba Team Member (since 2001) https://samba.org
Samba Team Lead, Catalyst IT   https://catalyst.net.nz/services/samba

Samba Development and Support, Catalyst IT - Expert Open Source 
Solutions








More information about the samba-technical mailing list