Commit c735a748 authored by Fabian Vogt's avatar Fabian Vogt
Browse files

Search in /usr/local/sbin:/usr/sbin:/sbin as fallback

Utilities such as lspci default to /usr/(local/)sbin/ as install location,
but that's not in $PATH for regular user sessions. It still works without
supeuser privileges, so just look there as well as a fallback.

BUG: 449792


(cherry picked from commit 1533db0a)
parent 6be2af7c
Pipeline #135833 passed with stage
in 2 minutes and 13 seconds
......@@ -19,6 +19,12 @@ CommandOutputContext::CommandOutputContext(const QString &executable, const QStr
, m_executablePath(QStandardPaths::findExecutable(m_executableName))
, m_arguments(arguments)
{
// Various utilities are installed in sbin, but work without elevated privileges
if (m_executablePath.isEmpty()) {
m_executablePath =
QStandardPaths::findExecutable(m_executableName, {QStringLiteral("/usr/local/sbin"), QStringLiteral("/usr/sbin"), QStringLiteral("/sbin")});
}
metaObject()->invokeMethod(this, &CommandOutputContext::load);
}
......
......@@ -44,7 +44,7 @@ private:
void setReady();
const QString m_executableName;
const QString m_executablePath;
QString m_executablePath;
const QStringList m_arguments;
QStringList m_originalLines;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment