1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

smbd: stat path before calling openat_pathref_fsp() in open_pathref_base_fsp()

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:04:01 +01:00
parent 91edc50dc0
commit c31fe2f9e7

View File

@ -392,6 +392,7 @@ static NTSTATUS open_pathref_base_fsp(const struct files_struct *dirfsp,
{
struct smb_filename *smb_fname_base = NULL;
NTSTATUS status;
int ret;
smb_fname_base = synthetic_smb_fname(talloc_tos(),
fsp->fsp_name->base_name,
@ -403,6 +404,11 @@ static NTSTATUS open_pathref_base_fsp(const struct files_struct *dirfsp,
return NT_STATUS_NO_MEMORY;
}
ret = vfs_stat(fsp->conn, smb_fname_base);
if (ret != 0) {
return map_nt_error_from_unix(errno);
}
status = openat_pathref_fsp(dirfsp, smb_fname_base);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(smb_fname_base);