Skip to content

Commit

Permalink
Consider application itself privileged
Browse files Browse the repository at this point in the history
Got some test failure due to unit test considered not having
privileges.
  • Loading branch information
pvuorela committed Dec 12, 2017
1 parent 2f988ff commit 976c047
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/notifications/notificationmanager.cpp
Expand Up @@ -1062,15 +1062,15 @@ uint NotificationManager::callerProcessId() const

bool NotificationManager::isPrivileged() const
{
if (!calledFromDBus()) {
return true;
}

uint pid = callerProcessId();
QFileInfo info(QString("/proc/%1").arg(pid));
if (info.group() != QLatin1String("privileged") && info.owner() != QLatin1String("root")) {
QString errorString = QString("PID %1 is not in privileged group").arg(pid);
if (calledFromDBus()) {
sendErrorReply(QDBusError::AccessDenied, errorString);
} else {
qWarning() << errorString;
}
sendErrorReply(QDBusError::AccessDenied, errorString);
return false;
}
return true;
Expand Down

0 comments on commit 976c047

Please sign in to comment.