Version: unspecified (using KDE 4.6.0) OS: Linux starting up partitionmanager as a normal user, kdesu's dialog pops out as expected, asking for root's password, I fill in the password (I'm sure, no mistakes :) but the program fails to execute with root's privileges and falls back to 'limited mode' (=cannot apply changes). Here's program output: marek@beruska music]$ partitionmanager partitionmanager partitionmanager-bin [marek@beruska music]$ partitionmanager which: no hal-lock in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/opt/oracle-sqldeveloper/bin:/usr/bin/core_perl:/opt/xxe/bin) kdesu(24160) startApp: Daemon not safe (not sgid), not using it. kdesu(24160)/kdesu (kdelibs) KDESu::PtyProcess::exec: [ /build/src/kdelibs-4.6.0/kdesu/process.cpp : 293 ] Running "/bin/su" kdesu(24160)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ /build/src/kdelibs-4.6.0/kdesu/su.cpp : 259 ] Read line "Password: " kdesu(24160)/kdesu (kdelibs) KDESu::PtyProcess::exec: [ /build/src/kdelibs-4.6.0/kdesu/process.cpp : 293 ] Running "/bin/su" kdesu(24160)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ /build/src/kdelibs-4.6.0/kdesu/su.cpp : 259 ] Read line "Password: " kdesu(24160)/kdesu (kdelibs) KDESu::PtyProcess::WaitSlave: [ /build/src/kdelibs-4.6.0/kdesu/process.cpp : 379 ] Child pid 24167 kdesu(24160)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ /build/src/kdelibs-4.6.0/kdesu/su.cpp : 259 ] Read line "" kdesu(24160)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ /build/src/kdelibs-4.6.0/kdesu/su.cpp : 259 ] Read line "kdesu_stub" kdesu(24160)/kdesu (kdelibs) KDESu::PtyProcess::exec: [ /build/src/kdelibs-4.6.0/kdesu/process.cpp : 293 ] Running "/bin/su" kdesu(24160)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ /build/src/kdelibs-4.6.0/kdesu/su.cpp : 259 ] Read line "Password: " kdesu(24160)/kdesu (kdelibs) KDESu::PtyProcess::WaitSlave: [ /build/src/kdelibs-4.6.0/kdesu/process.cpp : 379 ] Child pid 24172 kdesu(24160)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ /build/src/kdelibs-4.6.0/kdesu/su.cpp : 259 ] Read line "" kdesu(24160)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ /build/src/kdelibs-4.6.0/kdesu/su.cpp : 259 ] Read line "kdesu_stub" [marek@beruska music]$ sudo partitionmanager Password: which: no hal-lock in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/opt/oracle-sqldeveloper/bin:/usr/bin/core_perl:/opt/xxe/bin) No protocol specified partitionmanager-bin: cannot connect to X server :0 Thanks, Marek Reproducible: Always Steps to Reproduce: $ partitionmanager $ ls -l /usr/bin/partitionmanager -rwxr-xr-x 1 root root 1094 Sep 1 15:50 /usr/bin/partitionmanager
called with kdesu directly it works ok. So $ partitionmanager opens a password dialog and fails $ kdesu partitionmanager opens the same dialog and succeeds.
Thank you for your interest in KDE Partition Manager and taking the time to submit this tracker entry. It appears some recent commits to kdesu's source code brought about a change in behaviour for kdesu that KDE Partition Manager is not prepared for. Background: When you run KDE Partition Manager as non-root user it internally re-runs itself with any of kdesu, kdesudo, gksudo or gksu (in this order) asking for privileges. On ArchLinux, the first one to be found is kdesu, so it is being used. To avoid endless redirects when elevating privileges fails KDE Partition Manager passes a "--dontsu" argument to the new instance of itself to remember not to ask again in that case. Now kdesu seems to have changed how it handles arguments from the command line with 4.6.0 and thus KDE Partition Manager fails to get root privileges for you. What KDE Partition Manager actually calls is this command: $ kdesu "/usr/bin/partitionmanager-bin --dontsu" If you run this from a shell you will find it does not work. So much for the analysis and the background; about what needs fixing I'm not yet sure.
Ossi, can I have your input on this? It seems you're maintaining kdesu from recent commits.
please post the *exact* arguments you are passing to kdesu and i may be able to tell you what to fix.
Thanks for trying to help, Ossi. I don't quite see what additional information you're asking for. Let me repeat: This fails from a shell: $ kdesu "/usr/bin/partitionmanager --dontsu" To get KDE Partition Manager out of the picture, this also does not work: $ kdesu "ls -l" Just in case, this is the relevant code from KDE Partition Manager (line 86ff): http://websvn.kde.org/branches/partitionmanager/1.0/partitionmanager/src/util/helpers.cpp?revision=1113777&view=markup
use either kdesu -c "ls -l" or kdesu ls -l
The former suggestion would lead to a special case just for kdesu in the code. That would be unfortunate, but I'll consider it if we don't reach any other solution here. The latter obviously does not work: $ kdesu ls -l kdesu: Unknown option 'l'. kdesu: Use --help to get a list of available command line options. As far as I can remember it, the kdesu "ls -l" approach worked when I implemented the code in question in KDE Partition Manager early in 2010. It still works with the other three privilege-elevation-methods, afaict. My suspicion is that maybe one of the patches to kdesu to change its escaping behaviour unintentionally broke this. Is this possible?
Guys, thank you both for such a quick support, this is really amazing! :) Good job and many thanks.
well, the -c syntax is quite like plain su. the argv-style syntax does indeed not quite work according to plan ... :} please spin off a bug report for that if you want to.
*** This bug has been marked as a duplicate of bug 265026 ***