]> git.ipfire.org Git - thirdparty/samba.git/commit
smbd: Add openat_pathref_fsp_dot()
authorVolker Lendecke <vl@samba.org>
Sun, 7 Sep 2025 19:56:30 +0000 (21:56 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 10 Sep 2025 08:35:31 +0000 (08:35 +0000)
commit83ece80ecc2baa52a3caa0ee3b0f954b005b2268
tree406eaf7de58198633c9843de78daad02b4343707
parentb14fa86c1251b8d82b8d3cbf457b11e086cc7fc3
smbd: Add openat_pathref_fsp_dot()

Very simple reopen of a directory as pathref. Too much magic in
openat_pathref_fsp_lcomp() leads to Bug 15897:
openat_pathref_fsp_lcomp() can return NT_STATUS_OK but still leave the
file descriptor at -1 for msdfs and smb1 posix reasons. When using it
in filename_convert_dirfsp_nosymlink() this bites us, the -1 can leak
into vfswrap_openat(). Avoid any magic by directly calling
SMB_VFS_OPENAT() with maximum NOFOLLOW/etc safety for this use case
and fail when this does not work.

This adds another flavor of openat_pathref_fsp, and at some point we
need to consolidate them again.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15897
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/files.c
source3/smbd/proto.h