summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-08 01:55:56 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:53:03 +0100
commit46675b5033169e1e954cd570413ce85b2c5e11fc (patch)
tree6428261b68c09bc833d824814ce284c19ebd2c65 /src/db
parent0754ff886f909f0404038eb9c99dd61be1acf5b9 (diff)
downloadsssd-46675b5033169e1e954cd570413ce85b2c5e11fc.tar.gz
sssd-46675b5033169e1e954cd570413ce85b2c5e11fc.tar.xz
sssd-46675b5033169e1e954cd570413ce85b2c5e11fc.zip
Pass the domain to upgrade functions
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.c4
-rw-r--r--src/db/sysdb_private.h6
-rw-r--r--src/db/sysdb_upgrade.c20
3 files changed, 17 insertions, 13 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index 7d6ef1908..62c33f232 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -1102,14 +1102,14 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
}
if (strcmp(version, SYSDB_VERSION_0_10) == 0) {
- ret = sysdb_upgrade_10(sysdb, &version);
+ ret = sysdb_upgrade_10(sysdb, domain, &version);
if (ret != EOK) {
goto done;
}
}
if (strcmp(version, SYSDB_VERSION_0_11) == 0) {
- ret = sysdb_upgrade_11(sysdb, &version);
+ ret = sysdb_upgrade_11(sysdb, domain, &version);
if (ret != EOK) {
goto done;
}
diff --git a/src/db/sysdb_private.h b/src/db/sysdb_private.h
index 1e3617789..4eea09041 100644
--- a/src/db/sysdb_private.h
+++ b/src/db/sysdb_private.h
@@ -113,8 +113,10 @@ int sysdb_upgrade_06(struct sysdb_ctx *sysdb, const char **ver);
int sysdb_upgrade_07(struct sysdb_ctx *sysdb, const char **ver);
int sysdb_upgrade_08(struct sysdb_ctx *sysdb, const char **ver);
int sysdb_upgrade_09(struct sysdb_ctx *sysdb, const char **ver);
-int sysdb_upgrade_10(struct sysdb_ctx *sysdb, const char **ver);
-int sysdb_upgrade_11(struct sysdb_ctx *sysdb, const char **ver);
+int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain,
+ const char **ver);
+int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain,
+ const char **ver);
int sysdb_upgrade_12(struct sysdb_ctx *sysdb, const char **ver);
int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver);
int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver);
diff --git a/src/db/sysdb_upgrade.c b/src/db/sysdb_upgrade.c
index 205c5bd02..673c633eb 100644
--- a/src/db/sysdb_upgrade.c
+++ b/src/db/sysdb_upgrade.c
@@ -424,7 +424,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
* then remove them from local */
domain_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
- SYSDB_DOM_BASE, sysdb->domain->name);
+ SYSDB_DOM_BASE, dom->name);
if (!domain_dn) {
ret = ENOMEM;
goto done;
@@ -439,13 +439,13 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
}
users_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
- SYSDB_TMPL_USER_BASE, sysdb->domain->name);
+ SYSDB_TMPL_USER_BASE, dom->name);
if (!users_dn) {
ret = ENOMEM;
goto done;
}
groups_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
- SYSDB_TMPL_GROUP_BASE, sysdb->domain->name);
+ SYSDB_TMPL_GROUP_BASE, dom->name);
if (!groups_dn) {
ret = ENOMEM;
goto done;
@@ -1010,7 +1010,8 @@ done:
return ret;
}
-int sysdb_upgrade_10(struct sysdb_ctx *sysdb, const char **ver)
+int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain,
+ const char **ver)
{
TALLOC_CTX *tmp_ctx;
@@ -1036,8 +1037,8 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, const char **ver)
return ret;
}
- basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_USER_BASE,
- sysdb->domain->name);
+ basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
+ SYSDB_TMPL_USER_BASE, domain->name);
if (basedn == NULL) {
ret = EIO;
goto done;
@@ -1124,7 +1125,8 @@ done:
return ret;
}
-int sysdb_upgrade_11(struct sysdb_ctx *sysdb, const char **ver)
+int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain,
+ const char **ver)
{
TALLOC_CTX *tmp_ctx;
errno_t ret;
@@ -1154,7 +1156,7 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, const char **ver)
}
basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_CUSTOM_SUBTREE,
- AUTOFS_ENTRY_SUBDIR, sysdb->domain->name);
+ AUTOFS_ENTRY_SUBDIR, domain->name);
if (basedn == NULL) {
ret = ENOMEM;
goto done;
@@ -1192,7 +1194,7 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, const char **ver)
continue;
}
- ret = sysdb_save_autofsentry(sysdb, sysdb->domain,
+ ret = sysdb_save_autofsentry(sysdb, domain,
(const char *) val->data,
key, value, NULL);
if (ret != EOK) {