summaryrefslogtreecommitdiff
path: root/src/db
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
parent1187a07ed4207c1c326fdf83915dddfe472b8620 (diff)
downloadsssd-95e94691178297f2b8225a83d43ae388cab04b45.tar.gz
sssd-95e94691178297f2b8225a83d43ae388cab04b45.tar.bz2
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')
-rw-r--r--src/db/sysdb.h12
-rw-r--r--src/db/sysdb_subdomains.c24
2 files changed, 6 insertions, 30 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 98cf6bcd..2bc858ed 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -235,13 +235,6 @@ struct sysdb_attrs {
/* sysdb_attrs helper functions */
struct sysdb_attrs *sysdb_new_attrs(TALLOC_CTX *mem_ctx);
-struct sysdb_subdom {
- const char *realm;
- const char *name;
- const char *flat_name;
- const char *id;
-};
-
struct range_info {
char *name;
uint32_t base_id;
@@ -373,10 +366,7 @@ errno_t sysdb_subdomain_store(struct sysdb_ctx *sysdb,
const char *name, const char *realm,
const char *flat_name, const char *domain_id);
-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);
errno_t sysdb_master_domain_update(struct sss_domain_info *domain);
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index d6692b6d..c2719075 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;