From c9eaf8c1e02c155b7ca7ffb2b1edade8a23ce1ff Mon Sep 17 00:00:00 2001 From: Pavel Reichl Date: Tue, 4 Nov 2014 08:52:54 +0000 Subject: SYSDB: sysdb_get_bool() return ENOENT & unit tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sysdb_get_bool() return ENOENT if no result is found. Unit test for sysdb_get_bool() & sysdb_set_bool() was added. This patch also fixes ldap_setup_enumeration() to handle ENOENT returned by sysdb_has_enumerated(). Resolves: https://fedorahosted.org/sssd/ticket/1991 Reviewed-by: Lukáš Slebodník --- src/providers/ldap/ldap_id_enum.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/providers') diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c index 9ffa3e5d..13d2a625 100644 --- a/src/providers/ldap/ldap_id_enum.c +++ b/src/providers/ldap/ldap_id_enum.c @@ -41,7 +41,11 @@ errno_t ldap_setup_enumeration(struct be_ctx *be_ctx, struct ldap_enum_ctx *ectx; ret = sysdb_has_enumerated(sdom->dom, &has_enumerated); - if (ret != EOK) { + if (ret == ENOENT) { + /* default value */ + has_enumerated = false; + ret = EOK; + } else if (ret != EOK) { return ret; } -- cgit