]> git.ipfire.org Git - thirdparty/samba.git/commit
smbd: use fsp_get_pathref_fd() for fstat() calls
authorRalph Boehme <slow@samba.org>
Mon, 5 Oct 2020 05:50:16 +0000 (07:50 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:30 +0000 (09:08 +0000)
commit450d7f134c7c1e6d88f00a58e83d962be0b0bb09
treeb175ec53f4fdb14e31a3bbaab1130dd1a0804547
parent5648662b2f2b91133d3ec8ece69a32955348fa23
smbd: use fsp_get_pathref_fd() for fstat() calls

If we can access the path to a file, by default we have FILE_READ_ATTRIBUTES
from the containing directory. See the section: "Algorithm to Check Access to an
Existing File" in MS-FSA.pdf.

So it's also safe to use a root opened pathref fd, as the root open is done on
the final component after a chdir() to the parent directory was done while still
impersonating the use. Qed.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_afsacl.c
source3/modules/vfs_default.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_streams_depot.c
source3/smbd/smb2_getinfo.c
source3/smbd/smb2_setinfo.c
source3/smbd/trans2.c
source3/smbd/vfs.c