From 4a5e9bea88983643a6fd7b95a6cfcf16f29044ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 30 Aug 2016 10:42:58 +0200 Subject: [PATCH 58/79] 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 Reviewed-by: Jakub Hrozek (cherry picked from commit a8361f37af31a8a9767056bd27c418c947293f56) --- 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 ac3049b62fa77f69d44ec5792139fe3378afb3f4..5b5745d6732987c6057788b2099f45ad0799f151 100644 --- a/src/responder/secrets/local.c +++ b/src/responder/secrets/local.c @@ -168,6 +168,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, @@ -306,7 +307,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.9.3