]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In smbd_smb2_getinfo_send(), use vfs_stat() utility function.
authorJeremy Allison <jra@samba.org>
Mon, 13 Dec 2021 21:45:13 +0000 (13:45 -0800)
committerJeremy Allison <jra@samba.org>
Wed, 15 Dec 2021 18:36:31 +0000 (18:36 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
source3/smbd/smb2_getinfo.c

index 6df4a37af179b3ba2ac14e26fd5ba4fe42a52dee..a918cc0338588327e28fd545c74f543e778d3d28 100644 (file)
@@ -340,23 +340,11 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
                         * handle (returned from an NT SMB). NT5.0 seems
                         * to do this call. JRA.
                         */
-
-                       if (fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH) {
-                               /* Always do lstat for UNIX calls. */
-                               if (SMB_VFS_LSTAT(conn, fsp->fsp_name)) {
-                                       DEBUG(3,("smbd_smb2_getinfo_send: "
-                                                "SMB_VFS_LSTAT of %s failed "
-                                                "(%s)\n", fsp_str_dbg(fsp),
-                                                strerror(errno)));
-                                       status = map_nt_error_from_unix(errno);
-                                       tevent_req_nterror(req, status);
-                                       return tevent_req_post(req, ev);
-                               }
-                       } else if (SMB_VFS_STAT(conn, fsp->fsp_name)) {
-                               DEBUG(3,("smbd_smb2_getinfo_send: "
-                                        "SMB_VFS_STAT of %s failed (%s)\n",
+                       int ret = vfs_stat(conn, fsp->fsp_name);
+                       if (ret != 0) {
+                               DBG_NOTICE("vfs_stat of %s failed (%s)\n",
                                         fsp_str_dbg(fsp),
-                                        strerror(errno)));
+                                        strerror(errno));
                                status = map_nt_error_from_unix(errno);
                                tevent_req_nterror(req, status);
                                return tevent_req_post(req, ev);