dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone
Blob Blame History Raw
From fea818f425178931cce9cbaccae9070e462d5659 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com>
Date: Tue, 18 Sep 2018 15:23:54 +0200
Subject: [PATCH] CONFDB: Skip 'local' domain if not supported

When SSSD is built without the support for local
domain, we should gracegully skip local domains
and let other domains start.

Resolves:
https://pagure.io/SSSD/sssd/issue/3828

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit 10fa27eddb9bbe135277d587c6a2de4b311da6df)
---
 src/confdb/confdb.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index 6370a0411d98b6611dd384e9ab0de1d580be9c2d..954c3ba766617f7cfcf637d9143c891bd998d7ff 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -945,8 +945,14 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
         goto done;
     }
 
-    if (local_provider_is_built()
-            && strcasecmp(domain->provider, "local") == 0) {
+    if (strcasecmp(domain->provider, "local") == 0) {
+        if (!local_provider_is_built()) {
+            DEBUG(SSSDBG_FATAL_FAILURE,
+                  "ID provider 'local' no longer supported, disabling\n");
+            ret = EINVAL;
+            goto done;
+        }
+
         /* If this is the local provider, we need to ensure that
          * no other provider was specified for other types, since
          * the local provider cannot load them.
-- 
2.14.4