1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-05 13:44:19 +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)) { if (NT_STATUS_IS_OK(status)) {
info = FILE_WAS_CREATED; info = FILE_WAS_CREATED;
} else { } else {
int ret;
/* Cope with create race. */ /* Cope with create race. */
if (!NT_STATUS_EQUAL(status, if (!NT_STATUS_EQUAL(status,
NT_STATUS_OBJECT_NAME_COLLISION)) { NT_STATUS_OBJECT_NAME_COLLISION)) {
@@ -4834,9 +4835,13 @@ static NTSTATUS open_directory(connection_struct *conn,
* NT_STATUS_OBJECT_NAME_COLLISION * NT_STATUS_OBJECT_NAME_COLLISION
* we still must lstat the path. * we still must lstat the path.
*/ */
ret = SMB_VFS_FSTATAT(
if (SMB_VFS_LSTAT(conn, smb_dname) conn,
== -1) { parent_dir_fname->fsp,
smb_fname_atname,
&smb_dname->st,
AT_SYMLINK_NOFOLLOW);
if (ret == -1) {
DEBUG(2, ("Could not stat " DEBUG(2, ("Could not stat "
"directory '%s' just " "directory '%s' just "
"opened: %s\n", "opened: %s\n",