From 21ca7a4af3e06e219a72b08ffe7916df6b7432c8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 23 Jan 2025 13:42:48 +0100 Subject: [PATCH] vfs: Allow WITH_BACKUP_INTENT in vfs openat functions 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 Reviewed-by: Ralph Boehme --- source3/modules/vfs_aio_pthread.c | 2 +- source3/modules/vfs_ceph.c | 2 +- source3/modules/vfs_ceph_new.c | 2 +- source3/modules/vfs_fruit.c | 2 +- source3/modules/vfs_glusterfs.c | 2 +- source3/modules/vfs_streams_depot.c | 2 +- source3/modules/vfs_streams_xattr.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source3/modules/vfs_aio_pthread.c b/source3/modules/vfs_aio_pthread.c index b099a6b5b52..bd0c94b8cce 100644 --- a/source3/modules/vfs_aio_pthread.c +++ b/source3/modules/vfs_aio_pthread.c @@ -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; } diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 49cbd17692f..3913cb01b2c 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -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; } diff --git a/source3/modules/vfs_ceph_new.c b/source3/modules/vfs_ceph_new.c index bdde986c5f6..52962c19a60 100644 --- a/source3/modules/vfs_ceph_new.c +++ b/source3/modules/vfs_ceph_new.c @@ -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; } diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 09d171bef8a..70829def8d6 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -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; } diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 48a76189096..63dc7a30b04 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -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; diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c index dd4f8f524f8..2f6d301ed0c 100644 --- a/source3/modules/vfs_streams_depot.c +++ b/source3/modules/vfs_streams_depot.c @@ -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; } diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index 7601e744198..ac01cc46043 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -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; } -- 2.47.2