summaryrefslogtreecommitdiffstats
path: root/server/confdb/confdb.h
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-02-27 13:35:33 -0500
committerSimo Sorce <ssorce@redhat.com>2009-02-27 17:11:23 -0500
commit24480f7fa3bf3f40bd9fb7c865f9e3b329bf3ed8 (patch)
tree735441471a4e8c5fcc2dd9b9311b000f44584e29 /server/confdb/confdb.h
parent60bbc5034e546b7df7a6f782e3353b863f49618b (diff)
downloadsssd-24480f7fa3bf3f40bd9fb7c865f9e3b329bf3ed8.tar.gz
sssd-24480f7fa3bf3f40bd9fb7c865f9e3b329bf3ed8.tar.xz
sssd-24480f7fa3bf3f40bd9fb7c865f9e3b329bf3ed8.zip
Refactor creation of domain_map into confdb
The NSS provider, the Data Provider backends and the InfoPipe all need access to the domain map provided by the confdb. Instead of reimplimenting it in multiple places, it is now provided in a pair of helper functions from the confdb. confdb_get_domains() returns a domain map by reference. Always returns the most up-to-date set of domains from the confdb. confdb_get_domains_list() returns an array of strings of all the domain names. Always returns the most up-to-date set of domains from the confdb. This patch also modifies the btreemap_get_keys() function to better handle memory and report allocation failures.
Diffstat (limited to 'server/confdb/confdb.h')
-rw-r--r--server/confdb/confdb.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/server/confdb/confdb.h b/server/confdb/confdb.h
index a1d808559..3bd0d0387 100644
--- a/server/confdb/confdb.h
+++ b/server/confdb/confdb.h
@@ -19,12 +19,25 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef _CONF_DB_H
+#define _CONF_DB_H
+
#include <stdbool.h>
#include "talloc.h"
#include "tevent.h"
+#include "util/btreemap.h"
#define CONFDB_FILE "config.ldb"
+struct sss_domain_info {
+ char *name;
+ char *basedn;
+ int enumerate;
+ bool has_provider;
+ char *provider;
+ bool legacy;
+};
+
struct confdb_ctx;
int confdb_add_param(struct confdb_ctx *cdb,
@@ -59,4 +72,11 @@ int confdb_init(TALLOC_CTX *mem_ctx,
int confdb_get_domains(struct confdb_ctx *cdb,
TALLOC_CTX *mem_ctx,
- char ***values);
+ struct btreemap **domains);
+
+int confdb_get_domains_list(struct confdb_ctx *cdb,
+ TALLOC_CTX *mem_ctx,
+ const char ***domain_names,
+ int *count);
+
+#endif