]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: reject FILE_ATTRIBUTE_TEMPORARY on directories
authorRalph Boehme <slow@samba.org>
Tue, 22 Nov 2022 06:31:52 +0000 (07:31 +0100)
committerRalph Boehme <slow@samba.org>
Mon, 28 Nov 2022 10:14:12 +0000 (10:14 +0000)
Cf MS-FSA 2.1.5.14.2

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Nov 28 10:14:12 UTC 2022 on sn-devel-184

selftest/knownfail.d/samba3.smb2.create.dosattr_tmp_dir [deleted file]
source3/smbd/dosmode.c

diff --git a/selftest/knownfail.d/samba3.smb2.create.dosattr_tmp_dir b/selftest/knownfail.d/samba3.smb2.create.dosattr_tmp_dir
deleted file mode 100644 (file)
index ab5e365..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.create.dosattr_tmp_dir\(.*\)
index 40fe7b5166aad5cbdedbea0421a495730e2f2a6e..2e3aa0934a7b804d38a17e34e8090c3f271e10fa 100644 (file)
@@ -918,6 +918,13 @@ int file_set_dosmode(connection_struct *conn,
                return -1;
        }
 
+       if ((S_ISDIR(smb_fname->st.st_ex_mode)) &&
+           (dosmode & FILE_ATTRIBUTE_TEMPORARY))
+       {
+               errno = EINVAL;
+               return -1;
+       }
+
        dosmode &= SAMBA_ATTRIBUTES_MASK;
 
        DEBUG(10,("file_set_dosmode: setting dos mode 0x%x on file %s\n",