Setting a maximum number of logins using the pam_limits
module results in an off-by-one number of logins. The
user is allowed to log in once to often.
Create an entry in /etc/security/limits.conf like:
testuser - maxlogins 1
and test. testuser can login twice.
The attached patch is tested to fix it in pam-0.74 and
pam CVS.
Explanation:
in check_logins(), there is a loop over the utmp
entries that increments count. count is then checked
against limit -- however it should use >= instead of >
because the current login isn't complete, and hence
isn't written to the utmp file yet.
Andrew G. Morgan
modules
bugfix
Public
|
Date: 2007-10-06 09:15 Logged In: NO |
|
Date: 2002-07-08 13:22 Logged In: NO |
|
Date: 2002-01-19 07:11 Logged In: YES |
| Filename | Description | Download |
|---|---|---|
| pam_limits.user.patch | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2002-01-19 07:11 | agmorgan |
| resolution_id | None | 2002-01-19 07:11 | agmorgan |
| assigned_to | nobody | 2002-01-19 07:11 | agmorgan |
| summary | pam_limits user maxlogins is off-by-one | 2002-01-19 07:11 | agmorgan |
| close_date | - | 2002-01-19 07:11 | agmorgan |
| File Added | 14698: pam_limits.user.patch | 2001-12-14 13:50 | bdeschouwer |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use