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:
parent
5572ae296e
commit
d78964c40b
@ -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.*
|
|
@ -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 *state =
|
||||||
(struct smbd_dirptr_lanman2_state *)private_data;
|
(struct smbd_dirptr_lanman2_state *)private_data;
|
||||||
bool ms_dfs_link = false;
|
bool ms_dfs_link = false;
|
||||||
uint32_t mode = 0;
|
|
||||||
|
|
||||||
if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) {
|
if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) {
|
||||||
if (SMB_VFS_LSTAT(state->conn, smb_fname) != 0) {
|
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)));
|
strerror(errno)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
} else if (!VALID_STAT(smb_fname->st) &&
|
} else if (!VALID_STAT(smb_fname->st) &&
|
||||||
SMB_VFS_STAT(state->conn, smb_fname) != 0) {
|
SMB_VFS_STAT(state->conn, smb_fname) != 0) {
|
||||||
/* Needed to show the msdfs symlinks as
|
/* Needed to show the msdfs symlinks as
|
||||||
@ -1779,16 +1779,18 @@ static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx,
|
|||||||
strerror(errno)));
|
strerror(errno)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*_mode = dos_mode_msdfs(state->conn, smb_fname);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ms_dfs_link) {
|
if (!get_dosmode) {
|
||||||
mode = dos_mode_msdfs(state->conn, smb_fname);
|
return true;
|
||||||
} else if (get_dosmode) {
|
|
||||||
mode = fdos_mode(smb_fname->fsp);
|
|
||||||
smb_fname->st = smb_fname->fsp->fsp_name->st;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*_mode = mode;
|
*_mode = fdos_mode(smb_fname->fsp);
|
||||||
|
smb_fname->st = smb_fname->fsp->fsp_name->st;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user