smbd: use dirfsp and atname in open_directory()
authorRalph Boehme <slow@samba.org>
Mon, 18 Dec 2023 11:35:58 +0000 (12:35 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 22 Jan 2024 12:00:56 +0000 (12:00 +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

source3/smbd/open.c

index 3685beae8ba819d3b889123a944e175e231f0c86..08656c42521438a252a50103b412dbaecdbae3a8 100644 (file)
@@ -4921,8 +4921,8 @@ static NTSTATUS open_directory(connection_struct *conn,
                };
                bool file_created;
 
-               status = reopen_from_fsp(fsp->conn->cwd_fsp,
-                                        fsp->fsp_name,
+               status = reopen_from_fsp(parent_dir_fname->fsp,
+                                        smb_fname_atname,
                                         fsp,
                                         &how,
                                         &file_created);