]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: check for conn->cwd_fsp in fd_close()
authorRalph Boehme <slow@samba.org>
Sat, 13 Jun 2020 14:22:20 +0000 (16:22 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 18 Jul 2020 05:58:41 +0000 (05:58 +0000)
This avoids doing the check in all callers.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index e8314fa0a3a386d572fd17f5adbbd6e2838dff88..5d56804e7e940412f7ccce00dda09ca98d64e468 100644 (file)
@@ -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);
        }