Bug 60883

Summary: kdesu cannot find su program
Product: [Applications] kdesu Reporter: Pawel Orzechowski <orzechowskip>
Component: generalAssignee: kdesu bugs tracker <kdesu-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Pawel Orzechowski 2003-07-07 17:03:13 UTC
Version:            (using KDE KDE 3.1.2)
Installed from:    RedHat RPMs
Compiler:          gcc 3.2.2 
OS:          Linux

When I try to envoke "kdesu <command>", after typing correctly root's password, I am shown following information:
"The program 'su' is not found!
Make sure your PATH is set correctly."
The 'su' command is in /bin and user's PATH is correct. I created brand new account, and situation is the same.
I found similiar error in the bug database and it says about changing permissions to /dev/ptmx, unfortunately my permissions are ok (666). I cannot find anything interesting in a strace ouptu also.
Comment 1 Waldo Bastian 2003-07-09 11:30:53 UTC
Subject: Re:  New: kdesu cannot find su program

The path to su is detected at configure time and compiled into kdesu. The 
RedHat packages are probably made with su in a different location. You may 
want to try if it helps if you make a link from /sbin/su or /usr/bin/su to 
/bin/su.

Cheers,
Waldo
Comment 2 Waldo Bastian 2003-07-09 12:56:08 UTC
Subject: kdelibs/kdesu

CVS commit by waba:

Look in path if su can't be found in the configured location. (BR60883)

  M +10 -2     su.cpp   1.28

- --- kdelibs/kdesu/su.cpp  #1.27:1.28
@@ -82,5 +82,13 @@ int SuProcess::exec(const char *password
     args += QCString(__KDE_BINDIR) + "/kdesu_stub";

- -    if (StubProcess::exec(__PATH_SU, args) < 0)
+    QCString command = __PATH_SU;
+    if (::access(__PATH_SU, X_OK) != 0)
+    {
+       command = QFile::encodeName(KGlobal::dirs()->findExe("su"));
+       if (command.isEmpty())
+          return check ? SuNotFound : -1;
+    }
+
+    if (StubProcess::exec(command, args) < 0)
     {
         return check ? SuNotFound : -1;
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/C/SxN4pvrENfboIRAl7cAJwNRNXQ7nBOqrua3Upl3YDDZm4c7gCffVvR
ecKZaxF4fcsTGin2j1Yerp4=
=eolz
-----END PGP SIGNATURE-----

Comment 3 Pawel Orzechowski 2003-07-21 12:49:39 UTC
Yeah, this is right, there was a bug in kde redhat packages, I have upgraded to 
new kdebase and now everything works OK. 
 
Regards 
 
Pawel