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

s3: libsmb: Call cli_dfs_target_check() from cli_cifs_rename_send().

Strips off any DFS prefix from the target if passed in.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
Jeremy Allison 2022-02-03 15:56:51 -08:00 committed by Noel Power
parent dd0317f6ec
commit 4473aea926

View File

@ -1323,6 +1323,7 @@ static struct tevent_req *cli_cifs_rename_send(TALLOC_CTX *mem_ctx,
uint8_t additional_flags = 0;
uint16_t additional_flags2 = 0;
uint8_t *bytes = NULL;
NTSTATUS status;
req = tevent_req_create(mem_ctx, &state, struct cli_cifs_rename_state);
if (req == NULL) {
@ -1337,6 +1338,18 @@ static struct tevent_req *cli_cifs_rename_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
/*
* Strip a MSDFS path from fname_dst if we were given one.
*/
status = cli_dfs_target_check(state,
cli,
fname_src,
fname_dst,
&fname_dst);
if (tevent_req_nterror(req, status)) {
return tevent_req_post(req, ev);
}
SSVAL(state->vwv+0, 0, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY);
bytes = talloc_array(state, uint8_t, 1);