|
Bugzilla – Full Text Bug Listing |
| Summary: | Cannot set RLIMIT_NPROC to unlimited via pam_limits | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Jatin Nansi <jayml206> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | dkopecek |
| Priority: | low | ||
| Version: | 1.8.7 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Attachments: |
Patch to only restorie RLIMIT_NPROC when _SC_CHILD_MAX returns -1
Patch to store RLIMIT_NPROC after the call to policy_init_session |
||
|
Description
Jatin Nansi
2012-07-31 08:00:55 MDT
Created attachment 353 [details]
Patch to only restorie RLIMIT_NPROC when _SC_CHILD_MAX returns -1
The following patch should fix this, please give it a try.
Fixed in sudo 1.8.6. Hi, I think this bug is still present in the latest sources. If I set the nproc limit via pam_limits to unlimited on a RHEL system, it gets set to the values which sudo inherited from the parent process. I've came up with an other solution, I'll attach the patch to this BZ. The problem is that if you set unlimited & unlimited (soft & hard) in pam_limits, then these setting are indistinguishable from the temporary nproc limit reset done inside sudo. To overcome this problem, I've moved the part that stores the parent process limits just after the policy_init_session call where all the PAM magic happens. That way, if pam_limits changes anything, it gets restored before sudo executes the requested command. Created attachment 374 [details]
Patch to store RLIMIT_NPROC after the call to policy_init_session
With Dan's patch applied I think there is no longer any reason to check sysconf(_SC_CHILD_MAX) and the saved value of RLIMIT_NPROC should always be restored. Actually, since it is only setuid() and not seteuid() that has the RLIMIT_NPROC check, this can be even simpler. I've just checked in the following: http://www.sudo.ws/repos/sudo/rev/1372f1909039 Fixed in sudo 1.8.8 |