summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/monitor/monitor.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index 3a7c4f21..44ce5f2c 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -52,6 +52,7 @@
#include "dbus/dbus.h"
#include "sbus/sssd_dbus.h"
#include "monitor/monitor_interfaces.h"
+#include "util/sssd-i18n.h"
/* ping time cannot be less then once every few seconds or the
* monitor will get crazy hammering children with messages */
@@ -2350,6 +2351,7 @@ int main(int argc, const char *argv[])
TALLOC_CTX *tmp_ctx;
struct mt_ctx *monitor;
int ret;
+ uid_t uid;
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -2382,6 +2384,13 @@ int main(int argc, const char *argv[])
poptFreeContext(pc);
+ uid = getuid();
+ if (uid != 0) {
+ DEBUG(1, ("Running under %d, must be root\n", uid));
+ ERROR("sssd must be run as root\n");
+ return 8;
+ }
+
tmp_ctx = talloc_new(NULL);
if (!tmp_ctx) {
return 7;