]> git.ipfire.org Git - thirdparty/samba.git/commit
libcli: New routine symlink_target_path for [MS-SMB2] 2.2.2.2.1.1
authorVolker Lendecke <vl@samba.org>
Wed, 3 Jul 2024 13:55:46 +0000 (15:55 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 4 Jul 2024 15:26:36 +0000 (15:26 +0000)
commitb91e257f565797849d384cce8f8a200755f71700
tree71b5053fc5544de3bfc270b6f9e97946798edd69
parent659cb9f728036e18834fac5bad99f8ef7ba5230e
libcli: New routine symlink_target_path for [MS-SMB2] 2.2.2.2.1.1

Right now the only user is the user-space symlink following in
smbd. We will use it in libsmb as well to correctly handle
STOPPED_ON_SYMLINK. When trying to upstream that code I found the
previous_slash function incredibly hard to understand.

This new routine makes copy of "const char *_name_in", so that we can
replace previous_slash with a simple strrchr_m. If that's too
slow (which I doubt, this is "only" chasing symlinks) we can always do
something smarter again.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
libcli/smb/reparse.c
libcli/smb/reparse.h