]> granicus.if.org Git - sudo/commit
SuSE Enterprise Linux uses RLIMIT_NPROC and _SC_CHILD_MAX interchangably.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 31 Jul 2012 15:11:25 +0000 (11:11 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 31 Jul 2012 15:11:25 +0000 (11:11 -0400)
commit9c321baa78bf750ec9d156185e31120112328a78
treece9ae80c37f1bbf5368ae5bd3c82baea905aac38
parentf205243bd7f3a0471d6990b1f0324048559410a1
SuSE Enterprise Linux uses RLIMIT_NPROC and _SC_CHILD_MAX interchangably.
This causes problems when setting RLIMIT_NPROC to RLIM_INFINITY due
to a bug in bash where bash tries to honor the value of _SC_CHILD_MAX
but treats a value of -1 as an error, and uses a default value of
32 instead.

Previously, we just checked RLIMIT_NPROC and, if it was unlimited,
restored the previous value of RLIMIT_NPROC.  However, that makes
it impossible to set nproc to unlimited.  We now only restore the
nproc resource limit if sysconf(_SC_CHILD_MAX) is negative.  In
most cases, pam_limits will set RLIMIT_NPROC for us.
src/sudo.c