RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1134430 - pam_limits does not always count the user logins correctly for testing maxlogins
Summary: pam_limits does not always count the user logins correctly for testing maxlogins
Keywords:
Status: CLOSED DUPLICATE of bug 1080023
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pam
Version: 7.1
Hardware: All
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-27 13:46 UTC by Tomas Mraz
Modified: 2014-09-10 14:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1054936
Environment:
Last Closed: 2014-09-10 14:47:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tomas Mraz 2014-08-27 13:46:21 UTC
Description of problem:
pam_limits has the ability to limit the number of logins for a user.  There are times where there is a utmp entry for a user who is not actually logged on (usually the result of a program crashing).   pam_limits will count this entry as a login and if this puts the user over the limit (in our case 1) the user cannot log in.

Version-Release number of selected component (if applicable):
pam-1.1.1-4

How reproducible:
You can sometimes get this condition by doing a kill -9 on the user's login process, generally more often if it is a X11/xdm login.   You can also create a bugus entry in utmp using utmpdump to restore the utmp file.

Steps to Reproduce:
1. utmpdump into a file
2. log a user off
3. restore the utmp from the file
4. If maxlogins = 1 you can't log on.

Actual results:

User cannot log on

Expected results:

User can log on.

Additional info:

pam_limits reads the utmp file to find the logins for a user but does not verify that the login is still active.  By checking the process PID of the entry you can determine this.  This is the mechanism that "who" uses (you won't see the "ghost" entries in "who".)  I have included a patch to pam_limits that uses the same mechanism as "who" to ensure that utmp records are valid.

Comment 2 Tomas Mraz 2014-09-10 14:47:46 UTC

*** This bug has been marked as a duplicate of bug 1080023 ***


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