smbd: use dirfsp and atname in open_directory()
authorRalph Boehme <slow@samba.org>
Mon, 18 Dec 2023 11:35:58 +0000 (12:35 +0100)
committerJule Anger <janger@samba.org>
Mon, 29 Jan 2024 11:59:41 +0000 (11:59 +0000)
On systems without /proc/fd support this avoid the expensive chdir()
logic in non_widelink_open(). open_file_ntcreate() already passes
dirfsp and atname to reopen_from_fsp(), it was just missed in the
conversion.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15549

Reviewed-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jan 22 12:00:56 UTC 2024 on atb-devel-224

(cherry picked from commit 2713023250f15cf9971d88620cab9dd4afd0dc73)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Mon Jan 29 11:59:41 UTC 2024 on atb-devel-224

source3/smbd/open.c

index 27c96c5de2e43ac930c370e9d7156257ab9020cc..c3b279285105a821268571c6b767cb2dde02887f 100644 (file)
@@ -4915,8 +4915,8 @@ static NTSTATUS open_directory(connection_struct *conn,
 
        if (access_mask & need_fd_access) {
                status = reopen_from_fsp(
-                       fsp->conn->cwd_fsp,
-                       fsp->fsp_name,
+                       parent_dir_fname->fsp,
+                       smb_fname_atname,
                        fsp,
                        O_RDONLY | O_DIRECTORY,
                        0,