mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
smbd: stat path before calling openat_pathref_fsp() in unlink_internals()
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
4f30c04462
commit
ab82dbc5ae
@ -3281,6 +3281,7 @@ NTSTATUS unlink_internals(connection_struct *conn,
|
||||
NTSTATUS status = NT_STATUS_OK;
|
||||
struct smb_filename *smb_fname_dir = NULL;
|
||||
TALLOC_CTX *ctx = talloc_tos();
|
||||
int ret;
|
||||
|
||||
/* Split up the directory from the filename/mask. */
|
||||
status = split_fname_dir_mask(ctx, smb_fname->base_name,
|
||||
@ -3457,6 +3458,15 @@ NTSTATUS unlink_internals(connection_struct *conn,
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = vfs_stat(conn, f);
|
||||
if (ret != 0) {
|
||||
status = map_nt_error_from_unix(errno);
|
||||
TALLOC_FREE(dir_hnd);
|
||||
TALLOC_FREE(frame);
|
||||
TALLOC_FREE(talloced);
|
||||
goto out;
|
||||
}
|
||||
|
||||
status = openat_pathref_fsp(conn->cwd_fsp, f);
|
||||
if (!NT_STATUS_IS_OK(status) &&
|
||||
!NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK))
|
||||
|
Loading…
x
Reference in New Issue
Block a user