mirror of
https://github.com/samba-team/samba.git
synced 2025-01-29 21:47:30 +03:00
7626bba6c1
open_pathref_fsp() opens an "embedded" fsp inside smb_fname as smb_fname->fsp. We call such an fsp a "pathref" fsp. On system that support O_PATH the low level openat() is done with O_PATH. On systems that lack support for O_PATH, we impersonate the root user as a fallback. Setting "is_pathref" in the fsp_flags before calling fd_openat() is what triggers the special low-level behaviour inside the VFS. The use of pathref fsps allows updating all callers of path based VFS functions like dos_mode(smb_fname) -> SMB_VFS_GET_DOS_ATTRIBUTES(smb_fname) -> SMB_VFS_GETXATTR(smb_fname) to use the handle based VFS function like fdos_mode(smb_fname->fsp) -> SMB_VFS_FGET_DOS_ATTRIBUTES(fsp) -> SMB_VFS_FGETXATTR(fsp) Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>