vfs_default: allow disabling /proc/fds and RESOLVE_NO_SYMLINK at compile time
authorRalph Boehme <slow@samba.org>
Tue, 19 Dec 2023 10:11:55 +0000 (11:11 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 22 Jan 2024 10:53:29 +0000 (10:53 +0000)
commit5c2f96442a25a1725809a28b3719afbc0bd01830
tree75e69862f03ffa8bc8943955ca1203097f978fa2
parentfdf3656d30cedf95f4d4cccc585f98db9ba03b28
vfs_default: allow disabling /proc/fds and RESOLVE_NO_SYMLINK at compile time

This will be used in CI to have a gitlab runner without all modern Linux
features we make use of as part of path processing:

- O_PATH
- openat2() with RESOLVE_NO_SYMLINKS
- somehow safely reopen an O_PATH file handle

That gives what a classix UNIX like AIX or Solaris offers feature wise.

Other OSes support other combinations of those features, but we leave the
exersize of possibly adding more runners supporting those combinations to the
reader.

The following list shows which features are available and used by Samba on a few
OSes:

        | O_PATH         | RESOLVE_NO_SYMLINKS | Safe reopen    | CI covered
--------|----------------|---------------------|----------------------------
        | Supported Used | Supported Used      | Supported Used |
============================================================================
Linux   | +         +    | +         +         | +         +    | +
FreeBSD | +         +    | + [1]     -         | + [2]     -    | -
AIX     | -         -    | -         -         | -         -    | +

[1] via open() flag O_RESOLVE_BENEATH
[2] via open() flag O_EMPTY_PATH

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15549

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/modules/vfs_default.c