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 create_msdfs_link()
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
5f4592d184
commit
f6f4baf919
@ -1380,6 +1380,8 @@ bool create_msdfs_link(const struct junction_map *jucn,
|
||||
char *path = NULL;
|
||||
connection_struct *conn;
|
||||
struct smb_filename *smb_fname = NULL;
|
||||
struct smb_filename *parent_fname = NULL;
|
||||
struct smb_filename *at_fname = NULL;
|
||||
bool ok;
|
||||
NTSTATUS status;
|
||||
bool ret = false;
|
||||
@ -1409,6 +1411,15 @@ bool create_msdfs_link(const struct junction_map *jucn,
|
||||
goto out;
|
||||
}
|
||||
|
||||
status = parent_pathref(frame,
|
||||
conn->cwd_fsp,
|
||||
smb_fname,
|
||||
&parent_fname,
|
||||
&at_fname);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
status = SMB_VFS_CREATE_DFS_PATHAT(conn,
|
||||
conn->cwd_fsp,
|
||||
smb_fname,
|
||||
@ -1417,8 +1428,8 @@ bool create_msdfs_link(const struct junction_map *jucn,
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
|
||||
int retval = SMB_VFS_UNLINKAT(conn,
|
||||
conn->cwd_fsp,
|
||||
smb_fname,
|
||||
parent_fname->fsp,
|
||||
at_fname,
|
||||
0);
|
||||
if (retval != 0) {
|
||||
goto out;
|
||||
|
Loading…
Reference in New Issue
Block a user