From ea9a1b158585b3626b8e25ed79b92c579502e58c Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Mon, 23 May 2011 07:08:01 -0400 Subject: Handle non-POSIX groups in nesting Added sysdb_attrs_get_bool() function Non-posix group processing - sysdb changes Non-posix group processing - ldap provider and nss responder --- src/db/sysdb.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/db/sysdb.c') diff --git a/src/db/sysdb.c b/src/db/sysdb.c index b23bac14..40b7c26c 100644 --- a/src/db/sysdb.c +++ b/src/db/sysdb.c @@ -333,6 +333,28 @@ int sysdb_attrs_get_uint32_t(struct sysdb_attrs *attrs, const char *name, return EOK; } +errno_t sysdb_attrs_get_bool(struct sysdb_attrs *attrs, const char *name, + bool *value) +{ + struct ldb_message_element *el; + int ret; + + ret = sysdb_attrs_get_el_int(attrs, name, false, &el); + if (ret) { + return ret; + } + + if (el->num_values != 1) { + return ERANGE; + } + + if (strcmp((const char *)el->values[0].data, "TRUE") == 0) + *value = true; + else + *value = false; + return EOK; +} + int sysdb_attrs_get_string_array(struct sysdb_attrs *attrs, const char *name, TALLOC_CTX *mem_ctx, const char ***string) { -- cgit