summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb_ranges.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-10-15 10:31:59 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-11-05 00:14:04 +0100
commit127baf2d277fc26c59ddabe3743dff8ac229ca77 (patch)
treeaea32adec823333fa8d7d529d94ff7f4327fa340 /src/db/sysdb_ranges.c
parent12c6dcf1980d402308fd9563530eb6f6445bee3a (diff)
downloadsssd-127baf2d277fc26c59ddabe3743dff8ac229ca77.tar.gz
sssd-127baf2d277fc26c59ddabe3743dff8ac229ca77.tar.xz
sssd-127baf2d277fc26c59ddabe3743dff8ac229ca77.zip
sysdb: look for ranges in the parent tree
Make sure the right sub-tree in the cache is used to search for ranges. Sub-domain trees do not have range objects only the tree of the parent domain.
Diffstat (limited to 'src/db/sysdb_ranges.c')
-rw-r--r--src/db/sysdb_ranges.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/db/sysdb_ranges.c b/src/db/sysdb_ranges.c
index f100f5b87..adbabf7ba 100644
--- a/src/db/sysdb_ranges.c
+++ b/src/db/sysdb_ranges.c
@@ -64,8 +64,11 @@ errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
goto done;
}
+ /* Ranges are stored in the tree of the parent domain */
basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_RANGE_BASE,
- sysdb->domain->name);
+ sysdb->domain->parent != NULL ?
+ sysdb->domain->parent->name :
+ sysdb->domain->name);
if (basedn == NULL) {
ret = EIO;
goto done;