From: Jeremy Allison Date: Mon, 13 Dec 2021 21:45:13 +0000 (-0800) Subject: s3: smbd: In smbd_smb2_getinfo_send(), use vfs_stat() utility function. X-Git-Tag: tdb-1.4.6~278 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0a41119f4ccebd8930cc79d6fe381ab4b363058;p=thirdparty%2Fsamba.git s3: smbd: In smbd_smb2_getinfo_send(), use vfs_stat() utility function. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c index 6df4a37af17..a918cc03385 100644 --- a/source3/smbd/smb2_getinfo.c +++ b/source3/smbd/smb2_getinfo.c @@ -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);