summaryrefslogtreecommitdiffstats
path: root/server/confdb
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-09-09 12:52:51 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-09-10 07:15:59 -0400
commit50a765495715b5bcf6d32389b45ae315c45ce9a4 (patch)
treee3152ce5cf9007e0687d9a7c144bb1a8d945885c /server/confdb
parentab66a19a3f9368723dfe569d4d31c6b2b9e6656c (diff)
downloadsssd-50a765495715b5bcf6d32389b45ae315c45ce9a4.tar.gz
sssd-50a765495715b5bcf6d32389b45ae315c45ce9a4.tar.xz
sssd-50a765495715b5bcf6d32389b45ae315c45ce9a4.zip
Check for valid min and max IDs in confdb_get_domains
Diffstat (limited to 'server/confdb')
-rw-r--r--server/confdb/confdb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c
index 7d89f75f2..778345f3a 100644
--- a/server/confdb/confdb.c
+++ b/server/confdb/confdb.c
@@ -784,6 +784,11 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
"minId", SSSD_MIN_ID);
domain->id_max = ldb_msg_find_attr_as_uint(res->msgs[0],
"maxId", 0);
+ if ((domain->id_max && (domain->id_max < domain->id_min)) ||
+ (domain->id_min < 0)){
+ ret = EINVAL;
+ goto done;
+ }
/* Do we allow to cache credentials */
if (ldb_msg_find_attr_as_bool(res->msgs[0], "cache-credentials", 0)) {
@@ -848,8 +853,9 @@ int confdb_get_domains(struct confdb_ctx *cdb,
}
if (cdb->doms == NULL) {
- DEBUG(0, ("No domains configured, fatal error!\n"));
+ DEBUG(0, ("No properly configured domains, fatal error!\n"));
ret = ENOENT;
+ goto done;
}
*domains = cdb->doms;