freebsd-src/lib/libutil
Olivier Certner 892654fe9b setusercontext(): Apply personal settings only on matching effective UID
Commit 35305a8dc1 (r211393) added a check on whether 'uid' was equal
to getuid() before calling setlogincontext().  Doing so still allows
a setuid program to apply resource limits and priorities specified in
a user-controlled configuration file ('~/.login_conf') where
a non-setuid program could not.  Plug the hole by checking instead that
the process' effective UID is the target one (which is likely what was
meant in the initial commit).

PR:                     271750
Reviewed by:            kib, des
MFC after:              2 weeks
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40351
2023-10-09 21:47:10 -04:00
..
tests forkpty: Avoid fd leak if fork() fails. 2023-08-17 13:48:42 +00:00
_secure_path.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
_secure_path.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
auth.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
cpuset.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
cpuset.c cpuset(3): Move cpuset's parselist function into libutil 2023-06-01 23:16:01 +02:00
expand_number.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
expand_number.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
flopen.3 Remove my middle name. 2023-08-17 15:08:30 +02:00
flopen.c Remove my middle name. 2023-08-17 15:08:30 +02:00
fparseln.3 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
fparseln.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
getlocalbase.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
getlocalbase.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
gr_util.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
hexdump.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
hexdump.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
humanize_number.3 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
humanize_number.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kinfo_getallproc.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kinfo_getallproc.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kinfo_getfile.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kinfo_getfile.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kinfo_getproc.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kinfo_getproc.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kinfo_getvmmap.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kinfo_getvmmap.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kinfo_getvmobject.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kinfo_getvmobject.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kld.3 Remove my middle name. 2023-08-17 15:08:30 +02:00
kld.c Remove my middle name. 2023-08-17 15:08:30 +02:00
libutil.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
login.conf.5 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
login_auth.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
login_auth.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
login_cap.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
login_cap.c login_cap.c: Don't set errno to ERANGE on memory allocation failure 2023-10-02 16:41:22 -04:00
login_cap.h Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
login_class.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
login_class.c setusercontext(): Apply personal settings only on matching effective UID 2023-10-09 21:47:10 -04:00
login_crypt.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
login_ok.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
login_ok.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
login_times.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
login_times.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
login_tty.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
login_tty.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
pidfile.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
pidfile.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
property.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
property.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
pty.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
pty.c forkpty: Avoid fd leak if fork() fails. 2023-08-17 13:48:42 +00:00
pw_util.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
pw_util.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
quotafile.3 Remove my middle name. 2023-08-17 15:08:30 +02:00
quotafile.c Remove my middle name. 2023-08-17 15:08:30 +02:00
realhostname.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
realhostname.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
realhostname_sa.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
stub.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
trimdomain.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
trimdomain.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
uucplock.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
uucplock.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00