diff options
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/sysdb.h | 3 | ||||
-rw-r--r-- | src/db/sysdb_subdomains.c | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h index 0e2404c7..43ac61c2 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -371,7 +371,8 @@ errno_t sysdb_get_subdomains(TALLOC_CTX *mem_ctx, errno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name); errno_t sysdb_update_subdomains(struct sysdb_ctx *sysdb, - struct sysdb_subdom **subdomains); + int num_subdoms, + struct sysdb_subdom *subdoms); errno_t sysdb_get_subdomain_context(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c index 8f1df88b..8489041b 100644 --- a/src/db/sysdb_subdomains.c +++ b/src/db/sysdb_subdomains.c @@ -430,7 +430,8 @@ done: } errno_t sysdb_update_subdomains(struct sysdb_ctx *sysdb, - struct sysdb_subdom **subdomains) + int num_subdoms, + struct sysdb_subdom *subdoms) { int ret; int sret; @@ -475,9 +476,9 @@ errno_t sysdb_update_subdomains(struct sysdb_ctx *sysdb, * - if a subdomain already exists in sysdb, mark it for preservation * - if the subdomain doesn't exist in sysdb, create its bare structure */ - for (c = 0; subdomains[c] != NULL; c++) { + for (c = 0; c < num_subdoms; c++) { for (d = 0; d < cur_subdomains_count; d++) { - if (strcasecmp(subdomains[c]->name, + if (strcasecmp(subdoms[c].name, cur_subdomains[d]->name) == 0) { keep_subdomain[d] = true; /* sub-domain already in cache, nothing to do */ @@ -487,14 +488,14 @@ errno_t sysdb_update_subdomains(struct sysdb_ctx *sysdb, if (d == cur_subdomains_count) { DEBUG(SSSDBG_TRACE_FUNC, ("Adding sub-domain [%s].\n", - subdomains[c]->name)); - ret = sysdb_domain_create(sysdb, subdomains[c]->name); + subdoms[c].name)); + ret = sysdb_domain_create(sysdb, subdoms[c].name); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("sysdb_domain_create failed.\n")); goto done; } - ret = sysdb_add_subdomain_attributes(sysdb, subdomains[c]); + ret = sysdb_add_subdomain_attributes(sysdb, &subdoms[c]); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("sysdb_add_subdomain_attributes failed.\n")); |