Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 234513 - [LSPP] pam_namespace crashes with non-existent users in namespace.conf
Summary: [LSPP] pam_namespace crashes with non-existent users in namespace.conf
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: pam
Version: 5.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Tomas Mraz
QA Contact:
Depends On:
Blocks: RHEL5LSPPCertTracker
TreeView+ depends on / blocked
Reported: 2007-03-29 19:15 UTC by Linda Knippers
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version: RHSA-2007-0555
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-11-07 15:40:27 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2007:0555 normal SHIPPED_LIVE Moderate: pam security, bug fix, and enhancement update 2007-11-07 16:22:23 UTC

Description Linda Knippers 2007-03-29 19:15:58 UTC
Description of problem:
If the namespace.conf file includes in the list of user accounts to
not polyinstantiate an account that doesn't exist,
will fail and no users can log in.

Version-Release number of selected component (if applicable):
It was seen in pam- but I believe the problem
still exists in the latest code.

How reproducible:

Steps to Reproduce:
1.configure a system with configured as for an LSPP system.
This means pam_namespace in the /etc/pam.d/login file and the lines in
/etc/security/namespace.conf uncommented.
2.edit /etc/security/namespace.conf to add a login name for an account that
doesn't exist.
3.Try to log in 
Actual results: crashes and no users can log in.
If debug is enabled for the last line in 
/var/log/secure will be that its parsing the config file.

Expected results:
Users should be able to log in.

Additional info:

This is an untested patch.  I don't know if there are other
instances of the same problem.

--- pam_namespace.c     2007-03-29 15:02:06.000000000 -0400
+++ pam_namespace.c.ljk 2007-03-29 15:08:59.000000000 -0400
@@ -302,6 +302,8 @@ static int process_line(char *line, cons
                 *tptr = '\0';

             pwd = getpwnam(ustr);
+            if (!pwd)
+               continue;
             *uidptr = pwd->pw_uid;
             if (i < count - 1) {
                 ustr = tptr + 1;

Comment 2 Tomas Mraz 2007-03-30 14:23:55 UTC
The patch isn't right but the bug is real. It is fixed in pam-

Comment 3 Linda Knippers 2007-03-30 14:30:52 UTC
Well, I said untested. :-)
I'll give the updated package a try.  Thanks.

Comment 4 Linda Knippers 2007-03-30 14:44:24 UTC
The new package solves the problem.  Thanks!

Comment 8 errata-xmlrpc 2007-11-07 15:40:27 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

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