1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

smbd: use filename_convert() in smb_file_rename_information()

Replaces direct calls to resolve_dfspath_wcard() and filename_convert(). On the
way to consolidate all callers of pathname processing onto filename_convert().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2020-03-26 14:49:33 +01:00 committed by Jeremy Allison
parent cd8c229d24
commit 41fbfc279b

View File

@ -7326,18 +7326,6 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
DEBUG(10,("smb_file_rename_information: got name |%s|\n",
newname));
if (req->flags2 & FLAGS2_DFS_PATHNAMES) {
status = resolve_dfspath_wcard(ctx, conn,
newname,
UCF_COND_ALLOW_WCARD_LCOMP,
!conn->sconn->using_smb2,
&newname,
&dest_has_wcard);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
}
/* Check the new name has no '/' characters. */
if (strchr_m(newname, '/')) {
return NT_STATUS_NOT_SUPPORTED;
@ -7415,8 +7403,13 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
return NT_STATUS_NO_MEMORY;
}
status = unix_convert(ctx, conn, base_name, &smb_fname_dst,
ucf_flags);
status = filename_convert(ctx,
conn,
base_name,
ucf_flags,
NULL,
NULL,
&smb_fname_dst);
/* If an error we expect this to be
* NT_STATUS_OBJECT_PATH_NOT_FOUND */