From: Ralph Boehme Date: Sat, 9 Nov 2024 15:15:08 +0000 (+0100) Subject: smbd: fix access_mask to FILE_APPEND_DATA mapping for POSIX opens X-Git-Tag: tdb-1.4.13~227 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47c5d97d82b4ed6ad3cd4bf91b5824234af1b319;p=thirdparty%2Fsamba.git smbd: fix access_mask to FILE_APPEND_DATA mapping for POSIX opens 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 Reviewed-by: Jeremy Allison --- diff --git a/selftest/knownfail.d/samba.tests.smb3unix b/selftest/knownfail.d/samba.tests.smb3unix deleted file mode 100644 index 2882296cba1..00000000000 --- a/selftest/knownfail.d/samba.tests.smb3unix +++ /dev/null @@ -1 +0,0 @@ -^samba.tests.smb3unix.samba.tests.smb3unix.Smb3UnixTests.test_copy_chunk_posix\(fileserver_smb1\) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index f69a788769e..444a7b85fd0 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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; }