summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb_subdomains.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-14 16:47:51 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-02-10 22:08:47 +0100
commit95e94691178297f2b8225a83d43ae388cab04b45 (patch)
tree5869555cf5490a7019b3f18d4fa647a9dae8b619 /src/db/sysdb_subdomains.c
parent1187a07ed4207c1c326fdf83915dddfe472b8620 (diff)
downloadsssd-95e94691178297f2b8225a83d43ae388cab04b45.tar.gz
sssd-95e94691178297f2b8225a83d43ae388cab04b45.tar.xz
sssd-95e94691178297f2b8225a83d43ae388cab04b45.zip
Remove sysdb_subdom completely
struct sss_domain_info is always used to represent domains now. Adjust tests accordingly.
Diffstat (limited to 'src/db/sysdb_subdomains.c')
-rw-r--r--src/db/sysdb_subdomains.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index d6692b6de..c27190757 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -394,7 +394,6 @@ errno_t sysdb_subdomain_store(struct sysdb_ctx *sysdb,
goto done;
}
-
ret = ldb_msg_add_string(msg, SYSDB_OBJECTCLASS, SYSDB_SUBDOMAIN_CLASS);
if (ret != LDB_SUCCESS) {
ret = sysdb_error_to_errno(ret);
@@ -461,9 +460,7 @@ done:
return ret;
}
-errno_t sysdb_update_subdomains(struct sss_domain_info *domain,
- int num_subdoms,
- struct sysdb_subdom *subdoms)
+errno_t sysdb_update_subdomains(struct sss_domain_info *domain)
{
int ret;
int sret;
@@ -508,9 +505,9 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain,
* - 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; c < num_subdoms; c++) {
+ for (c = 0; c < domain->subdomain_count; c++) {
for (d = 0; d < cur_subdomains_count; d++) {
- if (strcasecmp(subdoms[c].name,
+ if (strcasecmp(domain->subdomains[c]->name,
cur_subdomains[d]->name) == 0) {
keep_subdomain[d] = true;
/* sub-domain already in cache, nothing to do */
@@ -519,20 +516,9 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain,
}
if (d == cur_subdomains_count) {
- struct sss_domain_info *ns;
-
DEBUG(SSSDBG_TRACE_FUNC, ("Adding sub-domain [%s].\n",
- subdoms[c].name));
-
- ns = new_subdomain(tmp_ctx, domain,
- subdoms[c].name, subdoms[c].realm,
- subdoms[c].flat_name, subdoms[c].id);
- if (!ns) {
- DEBUG(SSSDBG_OP_FAILURE, ("new_subdomain failed.\n"));
- goto done;
- }
-
- ret = sysdb_subdomain_create(ns);
+ domain->subdomains[c]->name));
+ ret = sysdb_subdomain_create(domain->subdomains[c]);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, ("sysdb_subdomain_create failed.\n"));
goto done;