From: Jeremy Allison Date: Fri, 2 Sep 2022 19:33:48 +0000 (-0700) Subject: s3: libsmb: In cli_cifs_rename_send() (SMBmv) check for DFS source pathname. X-Git-Tag: talloc-2.4.0~1021 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=4da3c724d5b3a60cd4af83b0a301b96a0d2ee945;p=samba.git s3: libsmb: In cli_cifs_rename_send() (SMBmv) check for DFS source pathname. smbtorture3: SMB1-DFS-PATHS: test_smb1_mv() shows SMBmv uses DFS for src and dst. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 25864332743..b07e9457a59 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -1332,6 +1332,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; + char *fname_src_cp = NULL; NTSTATUS status; req = tevent_req_create(mem_ctx, &state, struct cli_cifs_rename_state); @@ -1364,9 +1365,22 @@ static struct tevent_req *cli_cifs_rename_send(TALLOC_CTX *mem_ctx, if (tevent_req_nomem(bytes, req)) { return tevent_req_post(req, ev); } + + /* + * SMBmv on a DFS share uses DFS names for src and dst. + * See smbtorture3: SMB1-DFS-PATHS: test_smb1_mv(). + */ + + fname_src_cp = smb1_dfs_share_path(state, cli, fname_src); + if (tevent_req_nomem(fname_src_cp, req)) { + return tevent_req_post(req, ev); + } bytes[0] = 4; - bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname_src, - strlen(fname_src)+1, NULL); + bytes = smb_bytes_push_str(bytes, + smbXcli_conn_use_unicode(cli->conn), + fname_src_cp, + strlen(fname_src_cp)+1, + NULL); if (tevent_req_nomem(bytes, req)) { return tevent_req_post(req, ev); }