]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Remove an unnecessary call to SMB_VFS_STAT()
authorVolker Lendecke <vl@samba.org>
Fri, 24 Jan 2025 12:45:31 +0000 (13:45 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 5 Feb 2025 00:07:30 +0000 (00:07 +0000)
smb_fname came out of filename_convert_dirfsp(), which already stat'ed
if the file exists. !VALID_STAT means new file.

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

index 42d4845e717f9dc63757a20ee68f39e47cecaa86..d3f08a53706fa77d68bc6b926ba78f16b1066547 100644 (file)
@@ -829,11 +829,9 @@ void reply_getatr(struct smb_request *req)
                        reply_nterror(req, status);
                        goto out;
                }
-               if (!VALID_STAT(smb_fname->st) &&
-                   (SMB_VFS_STAT(conn, smb_fname) != 0)) {
-                       DEBUG(3,("reply_getatr: stat of %s failed (%s)\n",
-                                smb_fname_str_dbg(smb_fname),
-                                strerror(errno)));
+               if (!VALID_STAT(smb_fname->st)) {
+                       DBG_NOTICE("File %s not found\n",
+                                  smb_fname_str_dbg(smb_fname));
                        reply_nterror(req,  map_nt_error_from_unix(errno));
                        goto out;
                }