s3: smbd: Consistently map EAs to user namespace
commitf4507b399cfd19ab37e6eada57ee15504ad9979a
authorDaniel Kobras <kobras@puzzle-itc.de>
Mon, 26 Sep 2022 08:27:19 +0000 (26 10:27 +0200)
committerJule Anger <janger@samba.org>
Mon, 31 Oct 2022 21:06:12 +0000 (31 21:06 +0000)
tree863104bd0b52778238e531e089c803b07a160edf
parent057f60cc71516de6d0f169bb74c7f8f7d88cc231
s3: smbd: Consistently map EAs to user namespace

Samba has always been mapping Windows EAs to the 'user' namespace on the
POSIX side. However, in the opposite direction, the mapping would also map
other user-readable POSIX EA namespaces to Windows EAs, only stripping the
'user' namespace prefix, and passing all other EA names verbatim.

This means any POSIX EA 'other.foo' collides with 'user.other.foo' on the
Windows side, hence the mapping of non-user namespaces is unreliable.
Also, copy operations via Windows would rename an existing POSIX EA
'other.foo' in the source file to 'user.other.foo' in the destination. The
'user' namespace, however, may not be enabled on the underlying filesystem,
leading to subtle failure modes like the ones reported in eg.
<https://bugzilla.samba.org/show_bug.cgi?id=15186>

Fix the issues by restricting the mapping to the 'user' POSIX EA namespace
consistently for either direction.

Link: https://lists.samba.org/archive/samba-technical/2022-September/137634.html
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15186

Signed-off-by: Daniel Kobras <kobras@puzzle-itc.de>
Reviewed-by: Michael Weiser <michael.weiser@atos.net>
Tested-by: Michael Weiser <michael.weiser@atos.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 34c6db64c2ff62673f8df218487cda4139c10843)
source3/smbd/smb2_trans2.c