s3: smbd: Consistently map EAs to user namespace

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

This changeset fixes the issues by restricting the mapping to the 'user' POSIX EA namespace consistently for either direction, and updates the documentation to match this behavior. It has been discussed on samba-technical starting at https://lists.samba.org/archive/samba-technical/2022-September/137634.html.

Checklist

  • Commits have Signed-off-by: with name/author being identical to the commit author
  • (optional) This MR is just one part towards a larger feature.
  • (optional, if backport required) Bugzilla bug filed and BUG: tag added
  • Test suite updated with functionality tests
  • Test suite updated with negative tests
  • Documentation updated
  • CI timeout is 3h or higher (see Settings/CICD/General pipelines/ Timeout)

Reviewer's checklist:

  • There is a test suite reasonably covering new functionality or modifications
  • Function naming, parameters, return values, types, etc., are consistent and according to README.Coding.md
  • This feature/change has adequate documentation added
  • No obvious mistakes in the code

Merge request reports

Loading