]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Convert reply_checkpath() to use filename_convert_dirfsp().
authorJeremy Allison <jra@samba.org>
Wed, 27 Jul 2022 23:21:52 +0000 (16:21 -0700)
committerVolker Lendecke <vl@samba.org>
Thu, 28 Jul 2022 16:34:54 +0000 (16:34 +0000)
One less use of filename_convert().

This is the acid test of filename_convert_dirfsp() pathname error
handling.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jul 28 16:34:54 UTC 2022 on sn-devel-184

source3/smbd/smb1_reply.c

index e2e164573e36813b03589014b36eeba465f1fce8..de38817ea76c00c69a4c2fd4a64bb3fe7a444c62 100644 (file)
@@ -561,7 +561,9 @@ void reply_checkpath(struct smb_request *req)
        struct smb_filename *smb_fname = NULL;
        char *name = NULL;
        NTSTATUS status;
+       struct files_struct *dirfsp = NULL;
        uint32_t ucf_flags = ucf_flags_from_smb_request(req);
+       NTTIME twrp = 0;
        TALLOC_CTX *ctx = talloc_tos();
 
        START_PROFILE(SMBcheckpath);
@@ -578,13 +580,16 @@ void reply_checkpath(struct smb_request *req)
 
        DEBUG(3,("reply_checkpath %s mode=%d\n", name, (int)SVAL(req->vwv+0, 0)));
 
-       status = filename_convert(ctx,
-                               conn,
-                               name,
-                               ucf_flags,
-                               0,
-                               &smb_fname);
-
+       if (ucf_flags & UCF_GMT_PATHNAME) {
+               extract_snapshot_token(name, &twrp);
+       }
+       status = filename_convert_dirfsp(ctx,
+                                        conn,
+                                        name,
+                                        ucf_flags,
+                                        twrp,
+                                        &dirfsp,
+                                        &smb_fname);
        if (!NT_STATUS_IS_OK(status)) {
                if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
                        reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,