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

Daniel Kobras kobras at puzzle-itc.de
Tue Sep 27 20:10:21 UTC 2022


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
-- 
Puzzle ITC Deutschland GmbH
Sitz der Gesellschaft: Eisenbahnstraße 1, 72072 
Tübingen

Eingetragen am Amtsgericht Stuttgart HRB 765802
Geschäftsführer: 
Lukas Kallies, Daniel Kobras, Mark Pröhl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-smbd-Consistently-map-EAs-to-user-namespace.patch
Type: text/x-patch
Size: 2985 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20220927/d474ef79/0001-s3-smbd-Consistently-map-EAs-to-user-namespace.bin>


More information about the samba-technical mailing list