Patch 0001: Report specifically that the config database could not be
opened (this was ambiguous if you tried to start SSSD and the user could
not create the config database file)

Patch 0002: Check whether monitor is being run as root, and exit with an
error message if it is not (the same as the tools).

-- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
From 61dc0d7072d49e1193ef73829a7346e459a189bf Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <[email protected]>
Date: Fri, 11 Sep 2009 15:54:12 -0400
Subject: [PATCH 1/2] Print error message when connection to the config db fails

---
 server/confdb/confdb.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c
index 8fbae2f..03a434a 100644
--- a/server/confdb/confdb.c
+++ b/server/confdb/confdb.c
@@ -665,6 +665,8 @@ int confdb_init(TALLOC_CTX *mem_ctx,
 
     ret = ldb_connect(cdb->ldb, confdb_location, 0, NULL);
     if (ret != LDB_SUCCESS) {
+        DEBUG(0, ("Unable to open config database [%s]\n",
+                  confdb_location));
         talloc_free(cdb);
         return EIO;
     }
-- 
1.6.2.5

From 2736891f1fa5d0bad9b64083c7b2e2e38f0dd2b7 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <[email protected]>
Date: Fri, 11 Sep 2009 16:13:35 -0400
Subject: [PATCH 2/2] Exit if the sssd is launched as a user other than root

---
 server/monitor/monitor.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index 3a7c4f2..44ce5f2 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;
-- 
1.6.2.5

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
sssd-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to