]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Take care of @GMT in SMB1's reply_ntcreate_and_X()
authorVolker Lendecke <vl@samba.org>
Tue, 12 Jul 2022 15:48:25 +0000 (17:48 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 25 Jul 2022 12:04:33 +0000 (12:04 +0000)
Next we want to avoid filename_convert() to take care of this. The
SMB2 code has a proper TWRP token anyway, so let's push the
@GMT-handling to the SMB1 code that will be converted to
filename_convert_dirfsp().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/smb1_nttrans.c

index b39465c383f6975640280615fa8557ae92582c92..2ada93bbfa2662e43f6a77969aaf04ce7401b5cf 100644 (file)
@@ -535,6 +535,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
        uint8_t oplock_granted = NO_OPLOCK_RETURN;
        struct case_semantics_state *case_state = NULL;
        uint32_t ucf_flags;
+       NTTIME twrp = 0;
        TALLOC_CTX *ctx = talloc_tos();
 
        START_PROFILE(SMBntcreateX);
@@ -624,8 +625,11 @@ void reply_ntcreate_and_X(struct smb_request *req)
        }
 
        ucf_flags = filename_create_ucf_flags(req, create_disposition);
+       if (ucf_flags & UCF_GMT_PATHNAME) {
+               extract_snapshot_token(fname, &twrp);
+       }
        status = filename_convert_dirfsp(
-               ctx, conn, fname, ucf_flags, 0, &dirfsp, &smb_fname);
+               ctx, conn, fname, ucf_flags, twrp, &dirfsp, &smb_fname);
 
        TALLOC_FREE(case_state);