Bug 175735 - Pam configurations which produce multiple lines of ourput crash userpasswd
Pam configurations which produce multiple lines of ourput crash userpasswd
Status: CLOSED RAWHIDE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: usermode (Show other bugs)
4.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-12-14 08:27 EST by Todd
Modified: 2013-07-02 19:12 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-01-03 09:43:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Todd 2005-12-14 08:27:02 EST
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 04:50:09 EST
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 05:45:47 EST
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 09:43:46 EST
usermode-1.85 is now built.

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