diff options
author | Simo Sorce <simo@redhat.com> | 2013-01-06 11:19:22 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-15 10:49:20 +0100 |
commit | 62dbfd0596aa15ddf0d9384f426814edcf627331 (patch) | |
tree | 1c2f564919c16c9d6e42ea29ec5b53a2ef75e0eb | |
parent | 9675bccabff4e79d224f64611ad9ff3e073b488e (diff) | |
download | sssd-62dbfd0596aa15ddf0d9384f426814edcf627331.tar.gz sssd-62dbfd0596aa15ddf0d9384f426814edcf627331.tar.bz2 sssd-62dbfd0596aa15ddf0d9384f426814edcf627331.zip |
Move range objects into their own top-level tree.
Storing ranges for multiple domains under any specific domain is
somewhat aritrary and unnecessary.
Put ranges under cn=ranges,cn=sysdb, without involving any specific
domain subtree.
This allows us to avoid using sysdb->domain in ranges functions.
Also storing other subdomains data under the parent domain tree felt
wrong, all other domain specific data is under their own subtree.
Moving this data in its own place seems a better solution.
-rw-r--r-- | src/db/sysdb.h | 2 | ||||
-rw-r--r-- | src/db/sysdb_ranges.c | 14 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h index f1a17c21..9f8c85be 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -40,7 +40,7 @@ #define SYSDB_TMPL_GROUP_BASE SYSDB_GROUPS_CONTAINER",cn=%s,"SYSDB_BASE #define SYSDB_TMPL_CUSTOM_BASE SYSDB_CUSTOM_CONTAINER",cn=%s,"SYSDB_BASE #define SYSDB_TMPL_NETGROUP_BASE SYSDB_NETGROUP_CONTAINER",cn=%s,"SYSDB_BASE -#define SYSDB_TMPL_RANGE_BASE SYSDB_RANGE_CONTAINER",cn=%s,"SYSDB_BASE +#define SYSDB_TMPL_RANGE_BASE SYSDB_RANGE_CONTAINER","SYSDB_BASE #define SYSDB_SUBDOMAIN_CLASS "subdomain" #define SYSDB_USER_CLASS "user" diff --git a/src/db/sysdb_ranges.c b/src/db/sysdb_ranges.c index f49a184f..07f53ac1 100644 --- a/src/db/sysdb_ranges.c +++ b/src/db/sysdb_ranges.c @@ -64,11 +64,7 @@ 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->parent != NULL ? - sysdb->domain->parent->name : - sysdb->domain->name); + basedn = ldb_dn_new(tmp_ctx, sysdb->ldb, SYSDB_TMPL_RANGE_BASE); if (basedn == NULL) { ret = EIO; goto done; @@ -173,8 +169,8 @@ errno_t sysdb_range_create(struct sysdb_ctx *sysdb, struct range_info *range) goto done; } - msg->dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_RANGE, - range->name, sysdb->domain->name); + msg->dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, + SYSDB_TMPL_RANGE, range->name); if (!msg->dn) { ret = ENOMEM; goto done; @@ -315,8 +311,8 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb, if (!keep_range[d]) { DEBUG(SSSDBG_TRACE_FUNC, ("Removing range [%s].\n", cur_ranges[d]->name)); - dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_RANGE, - cur_ranges[d]->name, sysdb->domain->name); + dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, + SYSDB_TMPL_RANGE, cur_ranges[d]->name); if (dn == NULL) { ret = ENOMEM; goto done; |