]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: Allow WITH_BACKUP_INTENT in vfs openat functions
authorVolker Lendecke <vl@samba.org>
Thu, 23 Jan 2025 12:42:48 +0000 (13:42 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 13 Feb 2025 08:41:35 +0000 (08:41 +0000)
BACKUP_INTENT has no real meaning so far throughout our code, so we
should ignore and thus allow it in our openat-intercepting functions.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_aio_pthread.c
source3/modules/vfs_ceph.c
source3/modules/vfs_ceph_new.c
source3/modules/vfs_fruit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c

index b099a6b5b52593c5c0c2b610724a62093dbe452e..bd0c94b8cce48c51d6e9eb071d432b9f0691b16a 100644 (file)
@@ -457,7 +457,7 @@ static int aio_pthread_openat_fn(vfs_handle_struct *handle,
        bool aio_allow_open = lp_parm_bool(
                SNUM(handle->conn), "aio_pthread", "aio open", false);
 
-       if (how->resolve != 0) {
+       if ((how->resolve & ~VFS_OPEN_HOW_WITH_BACKUP_INTENT) != 0) {
                errno = ENOSYS;
                return -1;
        }
index 49cbd17692f283b11a577d80d6bdd7fab9fc2638..3913cb01b2c1e62579530151bcf92d15e9d42198 100644 (file)
@@ -472,7 +472,7 @@ static int cephwrap_openat(struct vfs_handle_struct *handle,
        int result = -ENOENT;
        int dirfd = -1;
 
-       if (how->resolve != 0) {
+       if ((how->resolve & ~VFS_OPEN_HOW_WITH_BACKUP_INTENT) != 0) {
                errno = ENOSYS;
                return -1;
        }
index bdde986c5f6ddc02e2df4a41c6118ea08d192ef3..52962c19a609de0ddcd3020c09827dcb810cc36b 100644 (file)
@@ -2131,7 +2131,7 @@ static int vfs_ceph_openat(struct vfs_handle_struct *handle,
        int result = -ENOENT;
 
        START_PROFILE(syscall_openat);
-       if (how->resolve != 0) {
+       if ((how->resolve & ~VFS_OPEN_HOW_WITH_BACKUP_INTENT) != 0) {
                result = -ENOSYS;
                goto err_out;
        }
index 09d171bef8a6a98e1dab37b919f8e2593c95d18a..70829def8d657aac454b07ced0409443ff6ae22b 100644 (file)
@@ -1742,7 +1742,7 @@ static int fruit_openat(vfs_handle_struct *handle,
                                           how);
        }
 
-       if (how->resolve != 0) {
+       if ((how->resolve & ~VFS_OPEN_HOW_WITH_BACKUP_INTENT) != 0) {
                errno = ENOSYS;
                return -1;
        }
index 48a7618909677b6e33a8f0db7c2370726eaf7537..63dc7a30b046ab62c27bd282533f3710beffa61c 100644 (file)
@@ -731,7 +731,7 @@ static int vfs_gluster_openat(struct vfs_handle_struct *handle,
 
        START_PROFILE(syscall_openat);
 
-       if (how->resolve != 0) {
+       if ((how->resolve & ~VFS_OPEN_HOW_WITH_BACKUP_INTENT) != 0) {
                END_PROFILE(syscall_openat);
                errno = ENOSYS;
                return -1;
index dd4f8f524f81a30b06c0823fd50208001f50e62e..2f6d301ed0c1997a7715e3ef0d3f96fd82b4114f 100644 (file)
@@ -747,7 +747,7 @@ static int streams_depot_openat(struct vfs_handle_struct *handle,
                                           how);
        }
 
-       if (how->resolve != 0) {
+       if ((how->resolve & ~VFS_OPEN_HOW_WITH_BACKUP_INTENT) != 0) {
                errno = ENOSYS;
                return -1;
        }
index 7601e7441985bfea29280fb04a284a878f0df129..ac01cc460430a7dcd1a6ba009519e1eaf15549db 100644 (file)
@@ -416,7 +416,7 @@ static int streams_xattr_openat(struct vfs_handle_struct *handle,
                                           how);
        }
 
-       if (how->resolve != 0) {
+       if ((how->resolve & ~VFS_OPEN_HOW_WITH_BACKUP_INTENT) != 0) {
                errno = ENOSYS;
                return -1;
        }