From: Jeremy Allison Date: Thu, 3 Feb 2022 23:54:55 +0000 (-0800) Subject: s3: libsmb: Call cli_dfs_target_check() from cli_smb1_rename_send(). X-Git-Tag: tevent-0.12.0~779 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd0317f6ecb572a80893405daa83e079dbcdf113;p=thirdparty%2Fsamba.git s3: libsmb: Call cli_dfs_target_check() from cli_smb1_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 Reviewed-by: Noel Power --- diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 032c11b5e75..9e15843f120 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -1234,6 +1234,18 @@ static struct tevent_req *cli_smb1_rename_send(TALLOC_CTX *mem_ctx, return NULL; } + /* + * 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 (!NT_STATUS_IS_OK(status)) { + goto fail; + } + if (!push_ucs2_talloc(talloc_tos(), &converted_str, fname_dst, &converted_size_bytes)) { status = NT_STATUS_INVALID_PARAMETER;