smbd: Return OBJECT_NAME_NOT_FOUND if lcomp points outside the share
commitcee9586c6eeb8a332f4406d3a1fc47c11230f302
authorVolker Lendecke <vl@samba.org>
Tue, 24 Oct 2023 16:47:59 +0000 (24 18:47 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 7 Nov 2023 12:46:37 +0000 (7 12:46 +0000)
tree49acc79f7796f5e94dae6baab7cda8f3a6962e7b
parentc81d1d3fe4e3aeb2761dc539e8fb87d2ad862e5f
smbd: Return OBJECT_NAME_NOT_FOUND if lcomp points outside the share

filename_convert_dirfsp() is the only caller of
safe_symlink_target_path(). Right now this is not called with
"unparsed==0" because the last component is handled in
openat_pathref_fsp() and thus non_widelink_open(). I have code that
will change this, so that we can simplify
openat_pathref_fsp_case_insensitive() to directly call OPENAT, not
going through non_widelink_open. This will cause
safe_symlink_target_path() also be called for the last component,
which means it needs logic to distinguish between PATH_ and
NAME_NOT_FOUND.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/filename.c