Bug 175735 - Pam configurations which produce multiple lines of ourput crash userpasswd
Summary: Pam configurations which produce multiple lines of ourput crash userpasswd
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: usermode
Version: 4.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jindrich Novy
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-12-14 13:27 UTC by Todd
Modified: 2013-07-02 23:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-01-03 14:43:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Todd 2005-12-14 13:27:02 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050923 Fedora/1.0.7-1.EL (CK-IBM) Firefox/1.0.7

Description of problem:
When I set the pam system-auth to use the pam_passwdqc lib userpasswd crashes, due to the newlines produced from the pam lib.

password    requisite     /lib/security/$ISA/pam_passwdqc.so min=disabled,8,8,8,8 passphrase=0 enforce=users
password    sufficient    /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
password    required      /lib/security/$ISA/pam_deny.so

I see this issue up through the rawhide 1.84-1 usermode package.


Version-Release number of selected component (if applicable):
usermode-1.74-1 & usermode-1.84-1.i386.rpm

How reproducible:
Always

Steps to Reproduce:
1. Edit the /etc/pam.d/system-auth add these lines for password:

password    requisite     /lib/security/$ISA/pam_passwdqc.so min=disabled,8,8,8,8 passphrase=0 enforce=users
password    sufficient    /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
password    required      /lib/security/$ISA/pam_deny.so

2. As a normal non-root account attempt to run userpasswd
3. 
  

Actual Results:  [example@localhost ~]$ userpasswd
ERROR: unused data: `You can now choose the new password.

39 0
32
'.



Expected Results:  Gui should not produce output.

Additional info:

With the addition of this patch to the source:
--- usermode-1.74/userhelper-wrap.c.orig        2005-11-22 00:36:18.000000000 -0500
+++ usermode-1.74/userhelper-wrap.c     2005-11-22 00:36:38.000000000 -0500
@@ -431,7 +431,14 @@

                /* Snip off terminating newlines in the prompt string and save
                 * a pointer to interate the parser along. */
-               outline = strchr(prompt, '\n');
+                outline = strchr(prompt, '\n');
+                while (outline != NULL) {
+                    if ((outline[1] == NULL) || (isdigit(outline[1]))) {
+                        break;
+                    } else {
+                        outline = strchr(outline + 1, '\n');
+                    }
+                }
                if (outline != NULL) {
                        outline[0] = '\0';
                        outline++;


And these lines to the spec:
Patch: usermode-wrapper-newlines.patch
%patch -p1

Comment 1 Jindrich Novy 2005-12-15 09:50:09 UTC
Looks OK, just the outline[1] == NULL condition should be outline[1] == '\0' as
outline[1] is a char not a pointer. Needs to be tested.

Comment 2 Jindrich Novy 2006-01-03 10:45:47 UTC
Todd, thanks for the patch. Fix is confirmed and patch applied with correction
noted in comment #1. It will appear in 1.85.

Comment 3 Jindrich Novy 2006-01-03 14:43:46 UTC
usermode-1.85 is now built.


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