s3:vfs: streamline vfs_stat_fsp()
authorRalph Boehme <slow@samba.org>
Mon, 9 Sep 2019 06:03:53 +0000 (08:03 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 10 Sep 2019 19:05:30 +0000 (19:05 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/vfs.c

index c50ee55469d7af3748d4b3023ea7d729acf674b7..c08c7302a249b00c04b8a00a5a55a159358d525f 100644 (file)
@@ -1420,13 +1420,11 @@ NTSTATUS vfs_stat_fsp(files_struct *fsp)
                } else {
                        ret = SMB_VFS_STAT(fsp->conn, fsp->fsp_name);
                }
-               if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
-               }
        } else {
-               if(SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) != 0) {
-                       return map_nt_error_from_unix(errno);
-               }
+               ret = SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st);
+       }
+       if (ret == -1) {
+               return map_nt_error_from_unix(errno);
        }
        return NT_STATUS_OK;
 }