1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

smbd: use real dirfsp for SMB_VFS_UNLINKAT() in remove_msdfs_link()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2021-01-22 14:51:33 +01:00 committed by Jeremy Allison
parent b3375098ac
commit e5262e2804

View File

@ -1464,6 +1464,9 @@ bool remove_msdfs_link(const struct junction_map *jucn,
connection_struct *conn;
bool ret = False;
struct smb_filename *smb_fname;
struct smb_filename *parent_fname = NULL;
struct smb_filename *at_fname = NULL;
NTSTATUS status;
bool ok;
int retval;
@ -1496,9 +1499,19 @@ bool remove_msdfs_link(const struct junction_map *jucn,
return false;
}
status = parent_pathref(frame,
conn->cwd_fsp,
smb_fname,
&parent_fname,
&at_fname);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(frame);
return false;
}
retval = SMB_VFS_UNLINKAT(conn,
conn->cwd_fsp,
smb_fname,
parent_fname->fsp,
at_fname,
0);
if (retval == 0) {
ret = True;