From ebca46f6798f207545ee597a82fd9d680fb642bd Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Mon, 15 Oct 2012 10:31:59 +0200 Subject: [PATCH 03/17] 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. --- src/db/sysdb_ranges.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/db/sysdb_ranges.c b/src/db/sysdb_ranges.c index f100f5b..adbabf7 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; -- 1.7.7.6