1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

smbd: Use SMB_VFS_FSTATAT() instead of SMB_LSTAT()

Use the dirfsp when we have it available

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2023-08-31 16:35:47 +02:00 committed by Jeremy Allison
parent d4a05fc145
commit 5130ade688

View File

@ -4819,6 +4819,7 @@ static NTSTATUS open_directory(connection_struct *conn,
if (NT_STATUS_IS_OK(status)) {
info = FILE_WAS_CREATED;
} else {
int ret;
/* Cope with create race. */
if (!NT_STATUS_EQUAL(status,
NT_STATUS_OBJECT_NAME_COLLISION)) {
@ -4834,9 +4835,13 @@ static NTSTATUS open_directory(connection_struct *conn,
* NT_STATUS_OBJECT_NAME_COLLISION
* we still must lstat the path.
*/
if (SMB_VFS_LSTAT(conn, smb_dname)
== -1) {
ret = SMB_VFS_FSTATAT(
conn,
parent_dir_fname->fsp,
smb_fname_atname,
&smb_dname->st,
AT_SYMLINK_NOFOLLOW);
if (ret == -1) {
DEBUG(2, ("Could not stat "
"directory '%s' just "
"opened: %s\n",