]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
shadow_copy2: Ignore VFS_OPEN_HOW_WITH_BACKUP_INTENT
authorChristof Schmitt <cs@samba.org>
Tue, 1 Oct 2024 20:29:56 +0000 (13:29 -0700)
committerVolker Lendecke <vl@samba.org>
Wed, 2 Oct 2024 08:06:38 +0000 (08:06 +0000)
d1846452e96 vfs: Add VFS_OPEN_HOW_WITH_BACKUP_INTENT introduced
VFS_OPEN_HOW_WITH_BACKUP_INTENT for files opened with
FILE_OPEN_FOR_BACKUP_INTENT. shadow_copy2 refuses the open on a file if
any flage in how.resolve is set. Change the check in shadow_copy2 to
allow opening of files with VFS_OPEN_HOW_WITH_BACKUP_INTENT.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Oct  2 08:06:38 UTC 2024 on atb-devel-224

source3/modules/vfs_shadow_copy2.c

index b91d5c8242f142257d19167a9cfd94486f964eef..9b7d208bb7b8e2ceebf0f890a9457c006ffcc53d 100644 (file)
@@ -1562,7 +1562,7 @@ static int shadow_copy2_openat(vfs_handle_struct *handle,
        int ret;
        bool ok;
 
-       if (how.resolve != 0) {
+       if ((how.resolve & ~VFS_OPEN_HOW_WITH_BACKUP_INTENT) != 0) {
                errno = ENOSYS;
                return -1;
        }