1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-22 02:50:28 +03:00

smbd: Security fix for systems without O_PATH

Further up we add O_PATH manually. Initial development versions of
this code did set the is_pathref, but then I found this potential
problem. I forgot to remove this incarnation of is_pathref=true, doing
it now.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2022-08-04 16:44:44 +02:00 committed by Jeremy Allison
parent c89ae5f0f6
commit 99020ffef2

View File

@ -762,8 +762,8 @@ NTSTATUS openat_pathref_dirfsp_nosymlink(
#ifdef O_PATH
/*
* Add O_PATH manually, doing this by setting
* fsp->fsp_flags.is_pathref will make us become_root(), which
* would cause a security problem.
* fsp->fsp_flags.is_pathref will make us become_root() in the
* non-O_PATH case, which would cause a security problem.
*/
flags |= O_PATH;
#else
@ -901,7 +901,6 @@ next:
nt_errstr(status));
goto fail;
}
fsp->fsp_flags.is_pathref = true;
fsp->fsp_name = &full_fname;
} else {
fsp = tmp;