vfs: define VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS
authorVolker Lendecke <vl@samba.org>
Fri, 3 Jun 2022 14:45:41 +0000 (16:45 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 15 Aug 2022 15:03:37 +0000 (15:03 +0000)
This will allow us to make use of openat2(RESOLVE_NO_SYMLINKS) soon.

The caller should check if connection_struct.open_how_resolve contains
VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS before using it, this avoids waisting
cpu time. But even then the caller must be prepared to handle -1/ENOSYS.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/include/vfs.h

index 866d2a5f4a8ddb06273f229cccdb04fcda465d34..2fd8d1cdd06b26fba7b3b9214e2d006b6ac9e6bc 100644 (file)
@@ -716,6 +716,7 @@ typedef struct connection_struct {
        bool ipc;
        bool read_only; /* Attributes for the current user of the share. */
        bool have_proc_fds;
+       uint64_t open_how_resolve; /* supported vfs_open_how.resolve features */
        uint32_t share_access;
        /* Does this filesystem honor
           sub second timestamps on files
@@ -905,6 +906,8 @@ struct vfs_aio_state {
        uint64_t duration;
 };
 
+#define VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS 1
+
 struct vfs_open_how {
        int flags;
        mode_t mode;