]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmb: Call cli_dfs_target_check() from cli_smb1_rename_send().
authorJeremy Allison <jra@samba.org>
Thu, 3 Feb 2022 23:54:55 +0000 (15:54 -0800)
committerNoel Power <npower@samba.org>
Fri, 4 Feb 2022 11:10:33 +0000 (11:10 +0000)
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>
source3/libsmb/clifile.c

index 032c11b5e7501ee4dee614ad45222ad75eb7131f..9e15843f1203c599d238b1478e368eb6a47656a9 100644 (file)
@@ -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;