]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: set fsp->dirfsp in open_directory()
authorRalph Boehme <slow@samba.org>
Mon, 18 May 2020 12:30:56 +0000 (14:30 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 21 May 2020 05:23:31 +0000 (05:23 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 5ab5ab9551a2655bb0b072d5368f887add327722..b6787b1767b88773b940f1157d9c3f85325a663b 100644 (file)
@@ -4474,6 +4474,12 @@ static NTSTATUS open_directory(connection_struct *conn,
                return status;
        }
 
+       if (*dirfsp == fsp->conn->cwd_fsp) {
+               fsp->dirfsp = fsp->conn->cwd_fsp;
+       } else {
+               fsp->dirfsp = talloc_move(fsp, dirfsp);
+       }
+
        /* Don't store old timestamps for directory
           handles in the internal database. We don't
           update them in there if new objects