]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In call_trans2qfilepathinfo(), we must have an existing object in the QPATH...
authorJeremy Allison <jra@samba.org>
Tue, 14 Dec 2021 17:46:51 +0000 (09:46 -0800)
committerJeremy Allison <jra@samba.org>
Wed, 15 Dec 2021 18:36:31 +0000 (18:36 +0000)
qpathinfo must operate on an existing file, so we
can exit early if filename_convert() returned the "new file"
NT_STATUS_OK, !VALID_STAT case.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
source3/smbd/trans2.c

index d778e88f1bb4f51c317197ee34922614c60282e3..b12f70d43ebd0c338d8f8149b59417cab304c128 100644 (file)
@@ -6110,6 +6110,17 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
                        return;
                }
 
+               /*
+                * qpathinfo must operate on an existing file, so we
+                * can exit early if filename_convert() returned the "new file"
+                * NT_STATUS_OK, !VALID_STAT case.
+                */
+
+               if (!VALID_STAT(smb_fname->st)) {
+                       reply_nterror(req, NT_STATUS_OBJECT_NAME_NOT_FOUND);
+                       return;
+               }
+
                /*
                 * smb_fname->fsp may be NULL if smb_fname points at a symlink
                 * and we're in POSIX context, so be careful when using fsp