Bug 78948

Summary: kdesu tell wrong password
Product: [Applications] kdesu Reporter: Giovanni Venturi <giovanni>
Component: generalAssignee: kdesu bugs tracker <kdesu-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: casteyde.christian, hubn3rd, wiz, zenith.federico
Priority: NOR    
Version: 1.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: bugfix-78948.diff

Description Giovanni Venturi 2004-04-03 01:42:45 UTC
Version:           2.0 (using KDE 3.2.1, compiled sources)
Compiler:          gcc version 3.3.3
OS:          Linux (i686) release 2.6.5-rc3

If I use Controll Center to set some option like administrator it tells me: "Wrong password" but I typed it correctly.
I take a console output to help you with this bug:

kdesu -c "kcmshell kcmfontinst --lang it"
kdesu (kdelibs): [process.cpp:263] Running `/bin/su'
kdesu (kdelibs): [su.cpp:180] Read line <Password: >
kdesu (kdelibs): [process.cpp:263] Running `/bin/su'
kdesu (kdelibs): [su.cpp:180] Read line <Password: >
kdesu (kdelibs): [process.cpp:350] Child pid 1099
kdesu (kdelibs): [su.cpp:180] Read line <>
kdesu (kdelibs): [su.cpp:180] Read line <-c: -c: No such file or directory>
Comment 1 David Pretty 2004-04-10 13:53:24 UTC
I'm having the same problem, 
	using compiled sources (CVS, kdelibs from 4 April 2004) on gentoo
	gcc 3.3.3
	Linux 2.6.3

though i can't see the console output you mention
Comment 2 Giovanni Venturi 2004-04-13 13:00:48 UTC
I fixed this bug with the attached patch.
Pratically the line 81 in kdelibs/kdesu/su.cpp in KDE_3_2_BRANCH and into HEAD 
(if into HEAD it's yet present I don't checked if it is so because I did not 
compiled HEAD but I think it's so because the file is the same till 5 days 
ago) have to be deleted. If you tell me ok I can commit into BRANCH and HEAD.


Created an attachment (id=5618)
bugfix-78948.diff
Comment 3 Waldo Bastian 2004-04-13 13:32:52 UTC
Patch is not correct, we want to get a login shell.

Does it help if you change:
    args += "-";
    args += "-c";
    args += QCString(__KDE_BINDIR) + "/kdesu_stub";
to
    args += "-c";
    args += QCString(__KDE_BINDIR) + "/kdesu_stub";
    args += "-";
?
Comment 4 Giovanni Venturi 2004-04-13 15:13:24 UTC
> Patch is not correct, we want to get a login shell.
>
Well, I didn't understand how the things work, I just see the difference with 
a KDE 3.2.0 that it works. I tryed to understand the code, but in few time 
it's difficult.
> Does it help if you change:
>     args += "-";
>     args += "-c";
>     args += QCString(__KDE_BINDIR) + "/kdesu_stub";
> to
>     args += "-c";
>     args += QCString(__KDE_BINDIR) + "/kdesu_stub";
>     args += "-";
> ?
Yes. I tryed your suggest and it works. We can close this bug applying your 
chainge to KDE_3_2_BRANCH  and to the HEAD into kdelibs/kdesu/su.cpp.

Comment 5 Giovanni Venturi 2004-04-13 15:15:40 UTC
> Patch is not correct, we want to get a login shell.
>
Well, I didn't understand how the things work, I just see the difference with 
a KDE 3.2.0 that it works. I tryed to understand the code, but in few time 
it's difficult.
> Does it help if you change:
>     args += "-";
>     args += "-c";
>     args += QCString(__KDE_BINDIR) + "/kdesu_stub";
> to
>     args += "-c";
>     args += QCString(__KDE_BINDIR) + "/kdesu_stub";
>     args += "-";
> ?
Yes. I tryed your suggest and it works. We can close this bug applying your 
chainge to KDE_3_2_BRANCH  and to the HEAD into kdelibs/kdesu/su.cpp.

Comment 6 Waldo Bastian 2004-04-13 15:34:36 UTC
CVS commit by waba: 

put "-" after "-c <command>" (BR78948)
CCMAIL: 78948-done@bugs.kde.org


  M +2 -2      su.cpp   1.35


--- kdelibs/kdesu/su.cpp  #1.34:1.35
@@ -79,7 +79,7 @@ int SuProcess::exec(const char *password
     else
         args += m_User;
-    args += "-";
     args += "-c";
     args += QCString(__KDE_BINDIR) + "/kdesu_stub";
+    args += "-";
 
     QCString command = __PATH_SU;


Comment 7 Stephan Binner 2004-04-21 11:15:18 UTC
*** Bug 80049 has been marked as a duplicate of this bug. ***
Comment 8 Stephan Binner 2004-04-21 11:16:06 UTC
*** Bug 80034 has been marked as a duplicate of this bug. ***
Comment 9 Stephan Binner 2004-04-21 11:31:31 UTC
*** Bug 80055 has been marked as a duplicate of this bug. ***
Comment 10 Oliver Gantz 2004-04-24 17:06:56 UTC
The bug made it into KDE 3.2.2. The fix mentioned above solves the problem.
Comment 11 Waldo Bastian 2004-05-17 21:50:02 UTC
*** Bug 81757 has been marked as a duplicate of this bug. ***
Comment 12 Heiko Munz 2006-10-05 23:38:12 UTC
I have the same problem with kdesu in KDE 3.5.5.
Debian SID
Kernel 2.6.17
Comment 13 Irene Korff 2006-10-16 16:19:12 UTC
Same here on Debian Etch. KDE 3.5.5, kernel 2.6.16-i686
Comment 14 Philipp Sternberg 2006-10-21 09:49:12 UTC
Yep, please reopen for kde 3.5.5 (Debian Etch, Kernel 2.6.17)
Comment 15 JmR 2006-10-22 09:03:27 UTC
One more here..
Debian Etch, kernel 2.6.17-2-amd64, KDE 3.5.5
Comment 16 Francis 2006-11-01 22:08:28 UTC
Another one:
Debian Etch, kernel 2.6.18-1, KDE 3.5.5
kdesu does not accept root password ("wrong password")
Comment 17 Felix Mueller 2006-12-21 23:03:06 UTC
I can confirm on suse 10.2 w/ kde 3.5.5 release 45 on kernel 2.6.18.2-34.
kdesu does not accept root password ("wrong password")
Comment 18 Raga Prong 2006-12-31 15:22:37 UTC
Same problem here on some Debian systems/KDE 3.5. I think that 
the problem is that kdesu fails to interpret the reason for failure
which seems to be that root is not allow to open X windows any
more. If I open a Konsole, type host +, su - and then try to start 
any KDE application, I get also some error message for invalid display.

If it is not possible to evaluate the error message from the called application, then I suggest to just change the error message string
into: 

Error while trying to run $application with root privileges. 
Maybe you mistyped root password, or root has no access to current display.
Comment 19 Felix Mueller 2006-12-31 15:38:49 UTC
The comment I posted above is not valid, as I could trace back the error to a bug in the sudo - yast module. Using visudo manually fixes the prob for me.
Comment 20 Travis Evans 2007-01-04 07:32:37 UTC
Same issue here on SUSE 10.2 with KDE 3.5.5... but in my case, the problem is that the message is wrong.  It prompts me for the root/administrator password, when what it really wants is my *user* password.  When I enter my *user* password, it works.  (I had added myself to the sudoers file and allowed myself to use sudo to run all commands as root by entering my user password).
Comment 21 Travis Evans 2007-01-04 07:34:38 UTC
Argh... I should've read Comment 19 before posting...