]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
setusercontext(): Apply personal settings only on matching effective UID
authorOlivier Certner <olce.freebsd@certner.fr>
Tue, 30 May 2023 16:35:08 +0000 (18:35 +0200)
committerEd Maste <emaste@FreeBSD.org>
Tue, 10 Oct 2023 01:47:10 +0000 (21:47 -0400)
commit892654fe9b5a9115815c30a423b8db47185aebbd
tree5f9df0fd46526eb8782428cf5420ef54df3e9940
parent6e92fc930943a85f311e986a02e2b3dae9e37126
setusercontext(): Apply personal settings only on matching effective UID

Commit 35305a8dc114 (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
lib/libutil/login_class.c