We've been searching for the wrong type ("simple") in
local_db_check_containers(), which always gives us a NULL result.

Let's introduce the new LOCAL_CONTAINER_FILTER and do the search for the
right type ("container") from now on.

Resolves:
https://fedorahosted.org/sssd/ticket/3137

Best Regards,
--
Fabiano Fidêncio
From a6e1efbcca357745e4eeb00309ef00089c8f94d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <[email protected]>
Date: Tue, 30 Aug 2016 10:42:58 +0200
Subject: [PATCH] SECRETS: Search by the right type when checking containers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We've been searching for the wrong type ("simple") in
local_db_check_containers(), which always gives us a NULL result.

Let's introduce the new LOCAL_CONTAINER_FILTER and do the search for the
right type ("container") from now on.

Resolves:
https://fedorahosted.org/sssd/ticket/3137

Signed-off-by: Fabiano Fidêncio <[email protected]>
---
 src/responder/secrets/local.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/responder/secrets/local.c b/src/responder/secrets/local.c
index d947052..109640f 100644
--- a/src/responder/secrets/local.c
+++ b/src/responder/secrets/local.c
@@ -173,6 +173,7 @@ char *local_dn_to_path(TALLOC_CTX *mem_ctx,
 }
 
 #define LOCAL_SIMPLE_FILTER "(type=simple)"
+#define LOCAL_CONTAINER_FILTER "(type=container)"
 
 int local_db_get_simple(TALLOC_CTX *mem_ctx,
                         struct local_context *lctx,
@@ -311,7 +312,7 @@ int local_db_check_containers(TALLOC_CTX *mem_ctx,
 
         /* and check the parent container exists */
         ret = ldb_search(lctx->ldb, mem_ctx, &res, dn, LDB_SCOPE_BASE,
-                         attrs, LOCAL_SIMPLE_FILTER);
+                         attrs, LOCAL_CONTAINER_FILTER);
         if (ret != LDB_SUCCESS) return ENOENT;
         if (res->count != 1) return ENOENT;
         talloc_free(res);
-- 
2.7.4

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

Reply via email to