]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: don't overwrite _mode if neither a msdfs symlink nor get_dosmode is requested
authorRalph Boehme <slow@samba.org>
Mon, 1 Feb 2021 11:37:10 +0000 (12:37 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 5 Feb 2021 06:22:35 +0000 (06:22 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14629

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

diff --git a/selftest/knownfail.d/samba3.smbtorture_s3 b/selftest/knownfail.d/samba3.smbtorture_s3
deleted file mode 100644 (file)
index 2b9c93a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-^samba3.smbtorture_s3.plain.POSIX-LS-WILDCARD.smbtorture.*
-^samba3.smbtorture_s3.crypt.POSIX-LS-WILDCARD.smbtorture.*
-^samba3.smbtorture_s3.plain.POSIX-LS-SINGLE.smbtorture.*
-^samba3.smbtorture_s3.crypt.POSIX-LS-SINGLE.smbtorture.*
index 6dbbe9cd7f131ab7f559bd0d84af5e1b640451b7..a2eb654647430b9a2f7f38cfb96fb28133833218 100644 (file)
@@ -1755,7 +1755,6 @@ static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx,
        struct smbd_dirptr_lanman2_state *state =
                (struct smbd_dirptr_lanman2_state *)private_data;
        bool ms_dfs_link = false;
-       uint32_t mode = 0;
 
        if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) {
                if (SMB_VFS_LSTAT(state->conn, smb_fname) != 0) {
@@ -1765,6 +1764,7 @@ static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx,
                                 strerror(errno)));
                        return false;
                }
+               return true;
        } else if (!VALID_STAT(smb_fname->st) &&
                   SMB_VFS_STAT(state->conn, smb_fname) != 0) {
                /* Needed to show the msdfs symlinks as
@@ -1779,16 +1779,18 @@ static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx,
                                 strerror(errno)));
                        return false;
                }
+
+               *_mode = dos_mode_msdfs(state->conn, smb_fname);
+               return true;
        }
 
-       if (ms_dfs_link) {
-               mode = dos_mode_msdfs(state->conn, smb_fname);
-       } else if (get_dosmode) {
-               mode = fdos_mode(smb_fname->fsp);
-               smb_fname->st = smb_fname->fsp->fsp_name->st;
+       if (!get_dosmode) {
+               return true;
        }
 
-       *_mode = mode;
+       *_mode = fdos_mode(smb_fname->fsp);
+       smb_fname->st = smb_fname->fsp->fsp_name->st;
+
        return true;
 }