smbd: Fix open_pathref_base_fsp()'s implicit conn_cwd assumption
authorVolker Lendecke <vl@samba.org>
Thu, 30 Dec 2021 17:06:18 +0000 (18:06 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 7 Feb 2022 19:00:34 +0000 (19:00 +0000)
commit0b55d73908840540fc997bc2982181268886a539
tree539b90685b9d9dfa9b55741d319c54f549ecf688
parentd4f8fdd69a1278d8473d541dc6b32014a369bcd0
smbd: Fix open_pathref_base_fsp()'s implicit conn_cwd assumption

Opening a stream base file only worked if "dirfsp == conn->cwd_fsp":
We have replaced fsp->fsp_name with the full dirfsp->relative pathname
at the point where open_pathref_base_fsp() is called. In case dirfsp
is already a subdirectory in a share, this breaks because the
open_pathref_base_fsp() uses fsp->fsp_name, not the original
dirfsp-relative one.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/files.c