From: Volker Lendecke Date: Sun, 15 Oct 2023 12:31:03 +0000 (+0200) Subject: smbd: Simplify reopen_from_fsp() X-Git-Tag: talloc-2.4.2~957 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3c20ea9df2ce8ce1b5c0f7a9a067e64ef61158a6;p=thirdparty%2Fsamba.git smbd: Simplify reopen_from_fsp() Pass down a dummy "file_created" variable in open_directory(), remove a unneeded if-condition. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index fa01a5d230f..0836ba078f8 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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),