If compiled without PAM support, enforce the limits from /etc/limits when
one of the -, -l, or --login options is set, even if called by root. Thanks to Justin Bronder.
This commit is contained in:
5
src/su.c
5
src/su.c
@ -790,8 +790,9 @@ int main (int argc, char **argv)
|
||||
}
|
||||
#else /* !USE_PAM */
|
||||
environ = newenvp; /* make new environment active */
|
||||
|
||||
if (!amroot) /* no limits if su from root */
|
||||
|
||||
/* no limits if su from root (unless su must fake login's behavior) */
|
||||
if (!amroot || fakelogin)
|
||||
setup_limits (&pwent);
|
||||
|
||||
if (setup_uid_gid (&pwent, is_console))
|
||||
|
Reference in New Issue
Block a user