s3: smbd: open_file(). Pass down the real parent_dir->fsp to smbd_check_access_rights...
authorJeremy Allison <jra@samba.org>
Tue, 8 Jun 2021 19:27:09 +0000 (12:27 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:31 +0000 (13:14 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/open.c

index 43b630c2d804fdf2b723491f75f4d39d17abdcd4..21dda0f596078759ed6d31d730c61e2c9c492bd0 100644 (file)
@@ -1365,7 +1365,7 @@ static NTSTATUS open_file(files_struct *fsp,
                        /* Only do this check on non-stream open. */
                        if (file_existed) {
                                status = smbd_check_access_rights_fsp(
-                                               fsp->conn->cwd_fsp,
+                                               parent_dir->fsp,
                                                fsp,
                                                false,
                                                access_mask);
@@ -1551,7 +1551,7 @@ static NTSTATUS open_file(files_struct *fsp,
                        }
                }
 
-               status = smbd_check_access_rights_fsp(fsp->conn->cwd_fsp,
+               status = smbd_check_access_rights_fsp(parent_dir->fsp,
                                                      fsp,
                                                      false,
                                                      access_mask);