]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: fix access_mask to FILE_APPEND_DATA mapping for POSIX opens
authorRalph Boehme <slow@samba.org>
Sat, 9 Nov 2024 15:15:08 +0000 (16:15 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 7 Jan 2025 22:04:32 +0000 (22:04 +0000)
Only use POSIX O_APPEND flag if the client requested FILE_APPEND_DATA without
FILE_WRITE_DATA.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/knownfail.d/samba.tests.smb3unix [deleted file]
source3/smbd/open.c

diff --git a/selftest/knownfail.d/samba.tests.smb3unix b/selftest/knownfail.d/samba.tests.smb3unix
deleted file mode 100644 (file)
index 2882296..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba.tests.smb3unix.samba.tests.smb3unix.Smb3UnixTests.test_copy_chunk_posix\(fileserver_smb1\)
index f69a788769e2e8b52c4e309e41fef2bbbb9f06cb..444a7b85fd0b1275e85a2c7b86b1848fa94fb5f0 100644 (file)
@@ -3868,7 +3868,10 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
        }
 #endif /* O_SYNC */
 
-       if (posix_open && (access_mask & FILE_APPEND_DATA)) {
+       if (posix_open &&
+           ((access_mask & FILE_APPEND_DATA) &&
+            !(access_mask & FILE_WRITE_DATA)))
+       {
                flags |= O_APPEND;
        }