]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In reply_ntrename(), move the call to get_original_lcomp(..newname..) after...
authorJeremy Allison <jra@samba.org>
Tue, 2 Aug 2022 21:16:15 +0000 (14:16 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 4 Aug 2022 17:09:31 +0000 (17:09 +0000)
This was the last case where the snapshot TWRP token could be
passed into get_original_lcomp(). get_original_lcomp() can now
be changed to ignore TWRP tokens.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/smb1_nttrans.c

index aa346a91ced21515672d31305ac6924eb1c41b07..05f341ae50526fe00e787ef3d3ef0aa70e88ba5e 100644 (file)
@@ -1489,16 +1489,6 @@ void reply_ntrename(struct smb_request *req)
                goto out;
        }
 
-       /* Get the last component of the destination for rename_internals(). */
-       dst_original_lcomp = get_original_lcomp(ctx,
-                                       conn,
-                                       newname,
-                                       ucf_flags_dst);
-       if (dst_original_lcomp == NULL) {
-               reply_nterror(req, NT_STATUS_NO_MEMORY);
-               goto out;
-       }
-
        if (stream_rename) {
                /*
                 * No point in calling filename_convert()
@@ -1543,6 +1533,17 @@ void reply_ntrename(struct smb_request *req)
                }
        }
 
+       /* Get the last component of the destination for rename_internals(). */
+       dst_original_lcomp = get_original_lcomp(ctx,
+                                       conn,
+                                       newname,
+                                       ucf_flags_dst);
+       if (dst_original_lcomp == NULL) {
+               reply_nterror(req, NT_STATUS_NO_MEMORY);
+               goto out;
+       }
+
+
        DEBUG(3,("reply_ntrename: %s -> %s\n",
                 smb_fname_str_dbg(smb_fname_old),
                 smb_fname_str_dbg(smb_fname_new)));