s3: libsmb: Call cli_dfs_target_check() from cli_smb2_rename_send().
authorJeremy Allison <jra@samba.org>
Thu, 3 Feb 2022 23:59:51 +0000 (15:59 -0800)
committerJule Anger <janger@samba.org>
Wed, 9 Feb 2022 10:23:20 +0000 (10:23 +0000)
Strips off any DFS prefix from the target if passed in.

Remove knownfail selftest/knownfail.d/msdfs-rename.

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>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Fri Feb  4 12:02:36 UTC 2022 on sn-devel-184

(cherry picked from commit b9b82f3611c56e837e9189f5275ae9a78e647262)

selftest/knownfail.d/msdfs-rename [deleted file]
source3/libsmb/cli_smb2_fnum.c

diff --git a/selftest/knownfail.d/msdfs-rename b/selftest/knownfail.d/msdfs-rename
deleted file mode 100644 (file)
index 1961e5d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.blackbox.smbclient_s3.SMB3.*.Rename\ on\ MS-DFS\ share\(.*\)
index f70639e41bd49294ec0bc804cb6de89387785468..cd0c06298ed1bb94aa7e429742901e2166e5aaa6 100644 (file)
@@ -3296,12 +3296,26 @@ struct tevent_req *cli_smb2_rename_send(
 {
        struct tevent_req *req = NULL, *subreq = NULL;
        struct cli_smb2_rename_state *state = NULL;
+       NTSTATUS status;
 
        req = tevent_req_create(
                mem_ctx, &state, struct cli_smb2_rename_state);
        if (req == NULL) {
                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 (tevent_req_nterror(req, status)) {
+               return tevent_req_post(req, ev);
+       }
+
        state->ev = ev;
        state->cli = cli;
        state->fname_dst = fname_dst;