1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

smbd: don't overwrite _mode if neither a msdfs symlink nor get_dosmode is requested

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>
This commit is contained in:
Ralph Boehme 2021-02-01 12:37:10 +01:00
parent 5572ae296e
commit d78964c40b
2 changed files with 9 additions and 11 deletions

View File

@ -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.*

View 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;
}