Bug 616823 - PAM usage of sudo is broken
Summary: PAM usage of sudo is broken
Alias: None
Product: Fedora
Classification: Fedora
Component: sudo   
(Show other bugs)
Version: 14
Hardware: All Linux
Target Milestone: ---
Assignee: Daniel Kopeček
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2010-07-21 13:42 UTC by Lennart Poettering
Modified: 2010-09-15 07:08 UTC (History)
3 users (show)

Fixed In Version: sudo-1.7.4p4-1.fc14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-09-15 07:08:57 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
gratisoft 421 None None None Never

Description Lennart Poettering 2010-07-21 13:42:15 UTC
sudo uses PAM incorrectly: it calls pam_open_session() immediately followed by
pam_close_session() and only then exec()s the actual process. 

pam_close_session() must be closed after the process terminates again, not
before. This issue confused a number of PAM modules quite a bit.

login(1) does that correctly. After calling pam_open_session() it forks, and
then in the parent process waits for the child to terminate and then calls


sudo must follow the same scheme.

Comment 1 Lennart Poettering 2010-07-21 13:43:02 UTC

Comment 2 Karel Zak 2010-07-21 14:29:12 UTC
sudo(8) does not fork(), it calls exec() only. This is feature...

It's necessary to start PAM session, because some resources are defined/restricted during session initialization (e.g. pam_limit). For more details see bug #154511.

Comment 3 Daniel Kopeček 2010-07-21 18:01:59 UTC
Upstream fix: http://www.sudo.ws/repos/sudo/rev/fb3d7de50a05

Comment 4 Bug Zapper 2010-07-30 12:43:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:

Comment 5 Fedora Update System 2010-09-07 16:14:29 UTC
sudo-1.7.4p4-1.fc14 has been submitted as an update for Fedora 14.

Comment 6 Fedora Update System 2010-09-07 18:36:59 UTC
sudo-1.7.4p4-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update sudo'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/sudo-1.7.4p4-1.fc14

Comment 7 Fedora Update System 2010-09-15 07:08:49 UTC
sudo-1.7.4p4-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.