]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Prevent fchmod on a symlink.
authorJeremy Allison <jra@samba.org>
Mon, 19 Apr 2021 23:38:00 +0000 (16:38 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 20 Apr 2021 08:23:42 +0000 (08:23 +0000)
Remove selftest/knownfail.d/symlink_chmod.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Apr 20 08:23:42 UTC 2021 on sn-devel-184

selftest/knownfail.d/symlink_chmod [deleted file]
source3/smbd/trans2.c

diff --git a/selftest/knownfail.d/symlink_chmod b/selftest/knownfail.d/symlink_chmod
deleted file mode 100644 (file)
index 8ebe2a7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-^samba3.smbtorture_s3.plain.*POSIX-SYMLINK-CHMOD
-^samba3.smbtorture_s3.crypt.*POSIX-SYMLINK-CHMOD
index 7c15a731e0d062be9ff1acfee71b0bf9c42d11a8..de8431175812f0591aeb3bedc6162bdabe6fc73f 100644 (file)
@@ -8324,6 +8324,12 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
        if (raw_unixmode != SMB_MODE_NO_CHANGE) {
                int ret;
 
+               if (fsp == NULL || S_ISLNK(smb_fname->st.st_ex_mode)) {
+                       DBG_WARNING("Can't set mode on symlink %s\n",
+                               smb_fname_str_dbg(smb_fname));
+                       return NT_STATUS_OBJECT_NAME_NOT_FOUND;
+               }
+
                DEBUG(10,("smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC "
                          "setting mode 0%o for file %s\n",
                          (unsigned int)unixmode,