1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00
Ralph Boehme 7626bba6c1 smbd: add openat_pathref_fsp()
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>
2020-12-16 09:08:30 +00:00
..
2020-01-06 01:47:30 +00:00
2017-04-07 22:52:24 +02:00
2020-10-02 21:30:33 +00:00
2020-10-24 05:57:31 +00:00
2020-03-20 17:11:28 +00:00
2019-02-28 13:53:40 +00:00
2020-12-16 09:08:30 +00:00
2017-12-05 04:58:26 +01:00
2020-08-17 19:35:38 +00:00
2020-05-21 20:38:31 +00:00
2017-03-16 20:30:19 +01:00
2020-12-16 09:08:30 +00:00