]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: set fsp->dirfsp in create_file_unixpath()
authorRalph Boehme <slow@samba.org>
Thu, 7 May 2020 14:52:20 +0000 (16:52 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 21 May 2020 05:23:32 +0000 (05:23 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index bb47ebc128d4e8663f304ad8244a7e639309b842..7e2d1b211879c9393cd7ccd9d5632272d3c135e0 100644 (file)
@@ -5670,6 +5670,12 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
                        goto fail;
                }
 
+               if (*dirfsp == fsp->conn->cwd_fsp) {
+                       fsp->dirfsp = fsp->conn->cwd_fsp;
+               } else {
+                       fsp->dirfsp = talloc_move(fsp, dirfsp);
+               }
+
                if (base_fsp) {
                        /*
                         * We're opening the stream element of a