]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Pass "dirfsp" through open_streams_for_delete()
authorVolker Lendecke <vl@samba.org>
Wed, 4 Dec 2024 18:29:03 +0000 (19:29 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 17 Dec 2024 12:30:31 +0000 (12:30 +0000)
One SMB_VFS_CREATE_FILE call less with "NULL" as dirfsp

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

index 7e6ccf4291061efc1eb7dd6aa23b36ee1a71dc08..f69a788769e2e8b52c4e309e41fef2bbbb9f06cb 100644 (file)
@@ -5423,6 +5423,7 @@ void msg_file_was_renamed(struct messaging_context *msg_ctx,
  */
 
 static NTSTATUS open_streams_for_delete(connection_struct *conn,
+                                       struct files_struct *dirfsp,
                                        const struct smb_filename *smb_fname)
 {
        struct stream_struct *stream_info = NULL;
@@ -5521,7 +5522,7 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn,
                status = SMB_VFS_CREATE_FILE(
                         conn,                  /* conn */
                         NULL,                  /* req */
-                        NULL,                  /* dirfsp */
+                        dirfsp,                /* dirfsp */
                         smb_fname_cp,          /* fname */
                         DELETE_ACCESS,         /* access_mask */
                         (FILE_SHARE_READ |     /* share_access */
@@ -6221,7 +6222,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
                 * We can't open a file with DELETE access if any of the
                 * streams is open without FILE_SHARE_DELETE
                 */
-               status = open_streams_for_delete(conn, smb_fname);
+               status = open_streams_for_delete(conn, dirfsp, smb_fname);
 
                if (!NT_STATUS_IS_OK(status)) {
                        goto fail;