From: Ralph Boehme Date: Sat, 13 Jun 2020 14:22:20 +0000 (+0200) Subject: smbd: check for conn->cwd_fsp in fd_close() X-Git-Tag: talloc-2.3.2~1070 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afdeba88194bc1b2ae66dd5e598211801698c189;p=thirdparty%2Fsamba.git smbd: check for conn->cwd_fsp in fd_close() This avoids doing the check in all callers. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- 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); }