QString ksniffPath = KStandardDirs::findExe("ksniff");
if (ksniffPath.isEmpty())
{
KMessageBox::sorry(0L, i18n("<p>The 'ksniff' executable was not found in your PATH<br>"
"environment. You need it to capture packets.<br><br>" \
"Your installation is not correct.</p>"));
return -1;
}
if (lstat(ksniffPath.ascii(), &statbuf) == -1)
{
KMessageBox::sorry(0L, i18n("<p>Cannot determine the 'ksniff' executable properties.<br>" \
"Your installation is not correct.</p>"));
return -1;
}
if ((S_ISUID & statbuf.st_mode) != S_ISUID)
{
KMessageBox::sorry(0L, i18n("<p>The 'ksniff' executable needs root privileges to capture packets.<br>" \
"Your installation is not correct.</p>"));
return -1;
}