]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Inside call_trans2setfilepathinfo(), for the TRANSACT2_SETPATHINFO case...
authorJeremy Allison <jra@samba.org>
Tue, 14 Dec 2021 00:54:07 +0000 (16:54 -0800)
committerJeremy Allison <jra@samba.org>
Wed, 15 Dec 2021 18:36:31 +0000 (18:36 +0000)
If we need a valid filesystem object, and we have a !VALID_STAT()
return from filename_convert(), the previous commit has already
errored out. We don't need a re-stat call here.

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

index 73a3bbae7cd715166f61e3d9e8ffd129e283493f..d778e88f1bb4f51c317197ee34922614c60282e3 100644 (file)
@@ -9432,24 +9432,6 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
                if (!VALID_STAT(smb_fname->st) && require_existing_object) {
                        reply_nterror(req, NT_STATUS_OBJECT_NAME_NOT_FOUND);
                }
-
-               if (INFO_LEVEL_IS_UNIX(info_level)) {
-                       /*
-                        * For CIFS UNIX extensions the target name may not exist.
-                        */
-
-                       /* Always do lstat for UNIX calls. */
-                       SMB_VFS_LSTAT(conn, smb_fname);
-
-               } else if (!VALID_STAT(smb_fname->st) &&
-                          SMB_VFS_STAT(conn, smb_fname)) {
-                       DEBUG(3,("call_trans2setfilepathinfo: SMB_VFS_STAT of "
-                                "%s failed (%s)\n",
-                                smb_fname_str_dbg(smb_fname),
-                                strerror(errno)));
-                       reply_nterror(req, map_nt_error_from_unix(errno));
-                       return;
-               }
        }
 
        DEBUG(3,("call_trans2setfilepathinfo(%d) %s (%s) info_level=%d "