summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/sysdb.c')
-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 493384d08..4b2b30356 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;
}
}