Workaround broken kdesu backward compatibility.
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1278089
This commit is contained in:
parent
9eef711325
commit
c987402691
|
@ -84,10 +84,22 @@ bool checkPermissions()
|
|||
// endless loops of calling the same non-working (kde|gk)su(do) binary again and again.
|
||||
if (!suCommand().isEmpty() && !args->isSet("dontsu"))
|
||||
{
|
||||
if (QProcess::execute(suCommand(), QStringList() << args->allArguments().join(" ") + " --dontsu") == 0)
|
||||
QStringList argList;
|
||||
|
||||
const QString suCmd = suCommand();
|
||||
|
||||
// kdesu broke backward compatibility at some point and now only works with "-c";
|
||||
// kdesudo accepts either (with or without "-c"), but the gk* helpers only work
|
||||
// without. kdesu maintainers won't fix their app, so we need to work around that here.
|
||||
if (suCmd.startsWith("kde"))
|
||||
argList << "-c";
|
||||
|
||||
argList << args->allArguments().join(" ") + " --dontsu";
|
||||
|
||||
if (QProcess::execute(suCmd, argList) == 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return KMessageBox::warningContinueCancel(NULL, i18nc("@info",
|
||||
"<para><warning>You do not have administrative privileges.</warning></para>"
|
||||
"<para>It is possible to run <application>%1</application> without these privileges. "
|
||||
|
|
Loading…
Reference in New Issue