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

smbd: use UCF_POSIX_PATHNAMES flag for path validation logic in filename_convert_internal()

This change means that if a client path is a symlink, we *always* only call
check_veto_path() for POSIX clients using a POSIX pathname, not just when a
POSIX info-level was used in an SMB request.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2020-10-22 11:04:59 +02:00
parent 71a5759623
commit 29e212dd6a

View File

@ -1961,9 +1961,10 @@ static NTSTATUS filename_convert_internal(TALLOC_CTX *ctx,
return status;
}
if ((ucf_flags & UCF_UNIX_NAME_LOOKUP) &&
VALID_STAT(smb_fname->st) &&
S_ISLNK(smb_fname->st.st_ex_mode)) {
if ((ucf_flags & UCF_POSIX_PATHNAMES) &&
VALID_STAT(smb_fname->st) &&
S_ISLNK(smb_fname->st.st_ex_mode))
{
status = check_veto_path(conn, smb_fname);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(smb_fname);