Permalink
Browse files

Add a check to pc-soundconfig to make sure that it is starting up wit…

…h root permissions (does not function as user).
  • Loading branch information...
1 parent b127b0c commit 9c8d91ac58c2b88eed5de12b4f94709591ff8fae Ken Moore committed Mar 24, 2014
Showing with 8 additions and 0 deletions.
  1. +8 −0 src-qt4/pc-soundconfig/main.cpp
@@ -6,8 +6,16 @@
#include "ui_snddialog.h"
#include "../config.h"
+#include <unistd.h>
+
int main( int argc, char ** argv )
{
+ // Make sure we are running as root
+ if (getuid() != 0) {
+ qDebug("Error, needs to be run as root");
+ exit(1);
+ }
+
QApplication a(argc, argv);
QTranslator translator;

0 comments on commit 9c8d91a

Please sign in to comment.