From: Ralph Boehme Date: Thu, 17 Dec 2020 11:41:29 +0000 (+0100) Subject: smbd: remove fd_close() from open_directory() X-Git-Tag: samba-4.14.0rc1~224 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebf37cfc3cb025171e0ceca321b343de82975c42;p=thirdparty%2Fsamba.git smbd: remove fd_close() from open_directory() fd_close() was accidentally added twice by d00d09fdcf73a5839ae4f82cf8e953bb761bfbfb. If it would have been removed by 5770cdd7635a018817418f58bd37268aedebd6a9 that adds the reopen_from_procfd() optimisation, all would be fine. But fd_close() still being called before reopen_from_procfd() means we're closing the pathref fd prevening the optimisation. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 6ba0f5759dd..801885fe26d 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -4639,11 +4639,6 @@ static NTSTATUS open_directory(connection_struct *conn, } } - status = fd_close(fsp); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - /* * Setup the files_struct for it. */