smbd: Hide the SMB1 posix symlink behaviour behind UCF_LCOMP_LNK_OK
authorVolker Lendecke <vl@samba.org>
Tue, 20 Dec 2022 20:26:10 +0000 (21:26 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 22 Dec 2022 19:50:34 +0000 (19:50 +0000)
commit636daef0fef98d79161377aab78ca6c403cb71c3
tree54b661299083b70c3ba74cc63336286aacfdff27
parent70b515be9c8fa5ff44cc2c2c1c9829f1591a371b
smbd: Hide the SMB1 posix symlink behaviour behind UCF_LCOMP_LNK_OK

This will be used in the future to also open symlinks as reparse
points, so this won't be specific to only SMB1 posix extensions.

I have tried to avoid additional flags for several weeks by making
openat_pathref_fsp or other flavors of this to always open fsp's with
symlink O_PATH opens, because I think NT_STATUS_OBJECT_NAME_NOT_FOUND
with a valid stat is a really bad and racy way to express that we just
hit a symlink, but I miserably failed. Adding additional flags (another one
will follow) is wrong, but I don't see another way right now.

Signed-off-by: Volker Lendecke <vl@samba.org>
source3/smbd/filename.c
source3/smbd/smbd.h