summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2020-06-13 16:22:20 +0200
committerJeremy Allison <jra@samba.org>2020-07-18 05:58:41 +0000
commitafdeba88194bc1b2ae66dd5e598211801698c189 (patch)
treedafc21be786b852cd60fcd05552aec74effb6634 /source3/smbd
parenta929644b28c6dc71594c1000cfaeeb0fde094184 (diff)
downloadsamba-afdeba88194bc1b2ae66dd5e598211801698c189.tar.gz
smbd: check for conn->cwd_fsp in fd_close()
This avoids doing the check in all callers. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/open.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index e8314fa0a3a..5d56804e7e9 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -908,6 +908,10 @@ NTSTATUS fd_close(files_struct *fsp)
{
int ret;
+ if (fsp == fsp->conn->cwd_fsp) {
+ return NT_STATUS_OK;
+ }
+
if (fsp->dptr) {
dptr_CloseDir(fsp);
}