Bug 233467

Summary: kdesu rejects valid root password when .bashrc outputs anything to stdout or stderr
Product: [Applications] kdesu Reporter: Tristan Miller <psychonaut>
Component: generalAssignee: kdesu bugs tracker <kdesu-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: tyrerj
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Unspecified   
Latest Commit: Version Fixed In:
Attachments: Fix for Bug 232617 & Bug 183671

Description Tristan Miller 2010-04-06 11:23:50 UTC
Version:            (using KDE 4.4.2)
Installed from:    openSUSE RPMs

Reproducibility: Always

Steps to reproduce:
1. Make sure ~/.bashrc outputs something to stdout or stderr.  For example, it could contain the following line:
   echo foo
2. Run kdesu and enter your root password.

Observed behaviour:
3. kdesu rejects the root password and reprompts.  Meanwhile the following is output to console:

$ kdesu echo foobar
kdesu(6522) KDESu::PtyProcess::exec: [ /usr/src/packages/BUILD/kdelibs-4.4.2/kdesu/process.cpp : 295 ]  Running "/bin/su"
kdesu(6522) KDESu::SuProcess::ConverseSU: [ /usr/src/packages/BUILD/kdelibs-4.4.2/kdesu/su.cpp : 259 ]  Read line "Password: "
kdesu(6522) KDESu::PtyProcess::exec: [ /usr/src/packages/BUILD/kdelibs-4.4.2/kdesu/process.cpp : 295 ]  Running "/bin/su"
kdesu(6522) KDESu::SuProcess::ConverseSU: [ /usr/src/packages/BUILD/kdelibs-4.4.2/kdesu/su.cpp : 259 ]  Read line "Password: "
kdesu(6522) KDESu::PtyProcess::WaitSlave: [ /usr/src/packages/BUILD/kdelibs-4.4.2/kdesu/process.cpp : 381 ]  Child pid 6530
kdesu(6522) KDESu::SuProcess::ConverseSU: [ /usr/src/packages/BUILD/kdelibs-4.4.2/kdesu/su.cpp : 259 ]  Read line ""
kdesu(6522) KDESu::SuProcess::ConverseSU: [ /usr/src/packages/BUILD/kdelibs-4.4.2/kdesu/su.cpp : 259 ]  Read line "foo"
kdesu_stub
$

Expected behaviour:
3. kdesu should not be sensitive to data printed to stdout or stderr by ~/.bashrc
Comment 1 Oswald Buddenhagen 2010-04-07 00:51:42 UTC

*** This bug has been marked as a duplicate of bug 183671 ***
Comment 2 James Richard Tyrer 2010-11-06 11:23:32 UTC
Created attachment 53187 [details]
Fix for Bug 232617 &  Bug 183671

This should fix both:

Bug 232617 for "You have new mail."

Bug 183671 for "Last login:"

I am not able to test it for  Bug 183671.
Comment 3 James Richard Tyrer 2010-11-06 12:04:10 UTC
*** Bug 232617 has been marked as a duplicate of this bug. ***