diff --git a/krusader/UserAction/kraction.cpp b/krusader/UserAction/kraction.cpp --- a/krusader/UserAction/kraction.cpp +++ b/krusader/UserAction/kraction.cpp @@ -241,6 +241,15 @@ if (! _action->startpath().isEmpty()) workingDir = _action->startpath(); + if (!_action->user().isEmpty()) { + if (!KrServices::isExecutable(KDESU_PATH)) { + KMessageBox::sorry(0, + i18n("Cannot run user action, %1 not found or not executable. " + "Please verify that kde-cli-tools are installed.", QString(KDESU_PATH))); + return; + } + } + if (_action->execType() == KrAction::RunInTE && (! MAIN_VIEW->terminalDock()->initialise())) { KMessageBox::sorry(0, i18n("Embedded terminal emulator does not work, using output collection instead.")); @@ -262,7 +271,8 @@ && MAIN_VIEW->terminalDock()->isInitialised()) { //send the commandline contents to the terminal emulator if (!_action->user().isEmpty()) { // "-t" is necessary that kdesu displays the terminal-output of the command - cmd = "kdesu -t -u " + _action->user() + " -c " + KrServices::quote(cmd); + cmd = KrServices::quote(KDESU_PATH) + + " -t -u " + _action->user() + " -c " + KrServices::quote(cmd); } MAIN_VIEW->terminalDock()->sendInput(cmd + '\n'); deleteLater(); @@ -295,7 +305,8 @@ cmd = KrServices::quote(termArgs).join(" "); } if (!_action->user().isEmpty()) { - cmd = "kdesu -u " + _action->user() + " -c " + KrServices::quote(cmd); + cmd = KrServices::quote(KDESU_PATH) + " -u " + _action->user() + + " -c " + KrServices::quote(cmd); } } else { // collect output @@ -312,7 +323,9 @@ if (!_action->user().isEmpty()) { // "-t" is necessary that kdesu displays the terminal-output of the command - cmd = "kdesu -t -u " + _action->user() + " -c " + KrServices::quote(cmd); + cmd = KrServices::quote(KDESU_PATH) + + " -t -u " + _action->user() + + " -c " + KrServices::quote(cmd); } } //printf("cmd: %s\n", cmd.toAscii().data()); @@ -682,4 +695,3 @@ return availabilityElement; } //KrAction::dumpAvailability -