summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-04-13 15:22:45 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-04-15 11:37:41 -0400
commitf16a4b30d7caef8745949c94bcc88716eb852f7b (patch)
treed8e0374f226b5d9d30ac78937a63ce0fbcb4bd15 /src/db
parent854da1d148cce68222c387af72293bfb46b9b8f3 (diff)
downloadsssd-f16a4b30d7caef8745949c94bcc88716eb852f7b.tar.gz
sssd-f16a4b30d7caef8745949c94bcc88716eb852f7b.tar.bz2
sssd-f16a4b30d7caef8745949c94bcc88716eb852f7b.zip
Run all appropriate upgrades
Previously, if we were upgrading from version 0.4 or older, we would only run sysdb_upgrade_04() and exit, instead of also running sysdb_upgrade_05()
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index 493384d0..4b2b3035 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -1669,11 +1669,27 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
if (strcmp(version, SYSDB_VERSION_0_4) == 0) {
ret = sysdb_upgrade_04(ctx, &version);
- goto done;
+ if (ret != EOK) {
+ goto done;
+ }
}
if (strcmp(version, SYSDB_VERSION_0_5) == 0) {
ret = sysdb_upgrade_05(ctx, &version);
+ if (ret != EOK) {
+ goto done;
+ }
+ }
+
+ /* The version should now match SYSDB_VERSION.
+ * If not, it means we didn't match any of the
+ * known older versions. The DB might be
+ * corrupt or generated by a newer version of
+ * SSSD.
+ */
+ if (strcmp(version, SYSDB_VERSION) == 0) {
+ /* all fine, return */
+ ret = EOK;
goto done;
}
}