]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmb: Call cli_dfs_target_check() from cli_smb2_hardlink_send().
authorJeremy Allison <jra@samba.org>
Thu, 3 Feb 2022 22:51:13 +0000 (14:51 -0800)
committerNoel Power <npower@samba.org>
Fri, 4 Feb 2022 11:10:33 +0000 (11:10 +0000)
Currently we don't pass MSDFS names as targets here, but a caller
may erroneously do this later, and for non-DFS names this is a no-op.

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 3c3f44923fcf48d2620d1f24c910009b3af25517..a65b79365ada743c72ff4123bda3224b8752742f 100644 (file)
@@ -1682,12 +1682,26 @@ static struct tevent_req *cli_smb2_hardlink_send(
 {
        struct tevent_req *req = NULL, *subreq = NULL;
        struct cli_smb2_hardlink_state *state = NULL;
+       NTSTATUS status;
 
        req = tevent_req_create(
                mem_ctx, &state, struct cli_smb2_hardlink_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;