]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: remove fd_close() from open_directory()
authorRalph Boehme <slow@samba.org>
Thu, 17 Dec 2020 11:41:29 +0000 (12:41 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Dec 2020 18:56:28 +0000 (18:56 +0000)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 6ba0f5759dd471e6e0d5b86310b5b16f644868d9..801885fe26ddc3ef87d373ff51f409f5891c60dc 100644 (file)
@@ -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.
         */