]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify reopen_from_fsp()
authorVolker Lendecke <vl@samba.org>
Sun, 15 Oct 2023 12:31:03 +0000 (14:31 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 1 Nov 2023 18:55:32 +0000 (18:55 +0000)
Pass down a dummy "file_created" variable in open_directory(), remove
a unneeded if-condition.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index fa01a5d230f1ffd1107708e219c6977739575e76..0836ba078f82558baa9694c29368e45ff1587a48 100644 (file)
@@ -1272,13 +1272,8 @@ static NTSTATUS reopen_from_fsp(struct files_struct *dirfsp,
                                const struct vfs_open_how *how,
                                bool *p_file_created)
 {
-       bool __unused_file_created = false;
        NTSTATUS status;
 
-       if (p_file_created == NULL) {
-               p_file_created = &__unused_file_created;
-       }
-
        /*
         * TODO: should we move this to the VFS layer?
         *       SMB_VFS_REOPEN_FSP()?
@@ -4918,12 +4913,13 @@ static NTSTATUS open_directory(connection_struct *conn,
                struct vfs_open_how how = {
                        .flags = O_RDONLY | O_DIRECTORY,
                };
+               bool file_created;
 
                status = reopen_from_fsp(fsp->conn->cwd_fsp,
                                         fsp->fsp_name,
                                         fsp,
                                         &how,
-                                        NULL);
+                                        &file_created);
                if (!NT_STATUS_IS_OK(status)) {
                        DBG_INFO("Could not open fd for [%s]: %s\n",
                                 smb_fname_str_dbg(smb_dname),