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:
nekral-guest
2007-10-12 22:36:26 +00:00
parent 756b6812a6
commit e3f303fdb5
3 changed files with 13 additions and 3 deletions

View File

@ -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))