]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Pass "dirfsp" to get_posix_fsp()
authorVolker Lendecke <vl@samba.org>
Wed, 4 Dec 2024 11:28:34 +0000 (12:28 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 17 Dec 2024 12:30:30 +0000 (12:30 +0000)
The two places where get_posix_fsp() is called we do have the dirfsp
around. Pass this through to SMB_VFS_CREATE_FILE(), looks much cleaner
in strace.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
source3/smbd/smb1_trans2.c

index ec7ae083a4db17abae2a70c3fcd25f610b27d720..dff7bf521f3332b15b2b077b4df660cead623f40 100644 (file)
@@ -2187,6 +2187,7 @@ static NTSTATUS smb_q_unix_info2(
 
 static NTSTATUS get_posix_fsp(connection_struct *conn,
                              struct smb_request *req,
+                             struct files_struct *dirfsp,
                              struct smb_filename *smb_fname,
                              uint32_t access_mask,
                              files_struct **ret_fsp)
@@ -2230,7 +2231,7 @@ static NTSTATUS get_posix_fsp(connection_struct *conn,
        status = SMB_VFS_CREATE_FILE(
                conn,        /* conn */
                req,         /* req */
-               NULL,        /* dirfsp */
+               dirfsp,      /* dirfsp */
                smb_fname,   /* fname */
                access_mask, /* access_mask */
                FILE_SHARE_READ | FILE_SHARE_WRITE |
@@ -2730,6 +2731,7 @@ static void call_trans2qpathinfo(
 
                status = get_posix_fsp(conn,
                                       req,
+                                      dirfsp,
                                       smb_fname,
                                       SEC_STD_READ_CONTROL |
                                               FILE_READ_ATTRIBUTES |
@@ -4517,6 +4519,7 @@ static void call_trans2setpathinfo(
 
                status = get_posix_fsp(conn,
                                       req,
+                                      dirfsp,
                                       smb_fname,
                                       SEC_STD_WRITE_OWNER |
                                               SEC_STD_WRITE_DAC |