summaryrefslogtreecommitdiffstats
path: root/server/confdb
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-08-31 10:10:59 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-31 15:09:53 -0400
commit2cfd9562a4e7fae31c226c12a467d0225d42a89f (patch)
tree5798ee4f237bf88a3a7709b2fd5280615ca13420 /server/confdb
parent83763b67a8e7fa6533a6389cace47ec83ef32d0b (diff)
downloadsssd-2cfd9562a4e7fae31c226c12a467d0225d42a89f.tar.gz
sssd-2cfd9562a4e7fae31c226c12a467d0225d42a89f.tar.xz
sssd-2cfd9562a4e7fae31c226c12a467d0225d42a89f.zip
Turn enumeration into a boolean value
Diffstat (limited to 'server/confdb')
-rw-r--r--server/confdb/confdb.c21
-rw-r--r--server/confdb/confdb.h2
2 files changed, 18 insertions, 5 deletions
diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c
index 70710d19f..03d8e67a9 100644
--- a/server/confdb/confdb.c
+++ b/server/confdb/confdb.c
@@ -683,7 +683,7 @@ int confdb_get_domain(struct confdb_ctx *cdb,
TALLOC_CTX *tmp_ctx;
struct ldb_dn *dn;
const char *tmp;
- int ret;
+ int ret, val;
tmp_ctx = talloc_new(mem_ctx);
if (!tmp_ctx) return ENOMEM;
@@ -744,9 +744,21 @@ int confdb_get_domain(struct confdb_ctx *cdb,
"timeout", 0);
/* Determine if this domain can be enumerated */
- domain->enumerate = ldb_msg_find_attr_as_int(res->msgs[0],
- "enumerate", 0);
- if (domain->enumerate == 0) {
+
+ /* TEMP: test if the old bitfield conf value is used and warn it has been
+ * superceeded. */
+ val = ldb_msg_find_attr_as_int(res->msgs[0], "enumerate", 0);
+ if (val > 0) { /* ok there was a number in here */
+ DEBUG(0, ("Warning: enumeration parameter in %s still uses integers! "
+ "Enumeration is now a boolean and takes true/false values. "
+ "Interpreting as true\n", domain->name));
+ domain->enumerate = true;
+ } else { /* assume the new format */
+ if (ldb_msg_find_attr_as_bool(res->msgs[0], "enumerate", 0)) {
+ domain->enumerate = true;
+ }
+ }
+ if (!domain->enumerate) {
DEBUG(1, ("No enumeration for [%s]!\n", domain->name));
}
@@ -782,6 +794,7 @@ int confdb_get_domain(struct confdb_ctx *cdb,
}
*_domain = domain;
+ ret = EOK;
done:
talloc_free(tmp_ctx);
diff --git a/server/confdb/confdb.h b/server/confdb/confdb.h
index 91eeff72d..f56508877 100644
--- a/server/confdb/confdb.h
+++ b/server/confdb/confdb.h
@@ -43,7 +43,7 @@ struct sss_domain_info {
char *name;
char *provider;
int timeout;
- int enumerate;
+ bool enumerate;
bool fqnames;
bool legacy;
bool mpg;