|
|
@ -329,7 +329,7 @@ void KdeSudo::receivedOut(KProcess*, char*buffer, int buflen)
|
|
|
|
|
|
|
|
|
|
|
|
static int badpass = 0;
|
|
|
|
static int badpass = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (strOut.tqfind("Sorry, try again")!=-1)
|
|
|
|
if (strOut.find("Sorry, try again")!=-1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
badpass++;
|
|
|
|
badpass++;
|
|
|
|
if (badpass>2)
|
|
|
|
if (badpass>2)
|
|
|
@ -339,37 +339,37 @@ void KdeSudo::receivedOut(KProcess*, char*buffer, int buflen)
|
|
|
|
kapp->quit();
|
|
|
|
kapp->quit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (strOut.tqfind("command not found")!=-1)
|
|
|
|
if (strOut.find("command not found")!=-1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bError=true;
|
|
|
|
bError=true;
|
|
|
|
KMessageBox::error(this, i18n("Command not found!"));
|
|
|
|
KMessageBox::error(this, i18n("Command not found!"));
|
|
|
|
kapp->quit();
|
|
|
|
kapp->quit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (strOut.tqfind("is not in the sudoers file")!=-1)
|
|
|
|
if (strOut.find("is not in the sudoers file")!=-1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bError=true;
|
|
|
|
bError=true;
|
|
|
|
KMessageBox::error(this, i18n("Your username is unknown to sudo!"));
|
|
|
|
KMessageBox::error(this, i18n("Your username is unknown to sudo!"));
|
|
|
|
kapp->quit();
|
|
|
|
kapp->quit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (strOut.tqfind("is not allowed to execute")!=-1)
|
|
|
|
if (strOut.find("is not allowed to execute")!=-1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bError=true;
|
|
|
|
bError=true;
|
|
|
|
KMessageBox::error(this, i18n("Your user is not allowed to run the specified command!"));
|
|
|
|
KMessageBox::error(this, i18n("Your user is not allowed to run the specified command!"));
|
|
|
|
kapp->quit();
|
|
|
|
kapp->quit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (strOut.tqfind("is not allowed to run sudo on")!=-1)
|
|
|
|
if (strOut.find("is not allowed to run sudo on")!=-1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bError=true;
|
|
|
|
bError=true;
|
|
|
|
KMessageBox::error(this, i18n("Your user is not allowed to run sudo on this host!"));
|
|
|
|
KMessageBox::error(this, i18n("Your user is not allowed to run sudo on this host!"));
|
|
|
|
kapp->quit();
|
|
|
|
kapp->quit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (strOut.tqfind("may not run sudo on")!=-1)
|
|
|
|
if (strOut.find("may not run sudo on")!=-1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bError=true;
|
|
|
|
bError=true;
|
|
|
|
KMessageBox::error(this, i18n("Your user is not allowed to run sudo on this host!"));
|
|
|
|
KMessageBox::error(this, i18n("Your user is not allowed to run sudo on this host!"));
|
|
|
|
kapp->quit();
|
|
|
|
kapp->quit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((strOut.tqfind("passprompt")!=-1) || (strOut.tqfind("PIN (CHV2)")!=-1))
|
|
|
|
if ((strOut.find("passprompt")!=-1) || (strOut.find("PIN (CHV2)")!=-1))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this->clearPassword();
|
|
|
|
this->clearPassword();
|
|
|
|
this->show();
|
|
|
|
this->show();
|
|
|
|