]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Reset ulog if database load failed
authorrbasch <probe@tardis.internal.bright-prospects.com>
Mon, 4 Mar 2013 03:55:41 +0000 (22:55 -0500)
committerTom Yu <tlyu@mit.edu>
Tue, 16 Apr 2013 16:33:06 +0000 (12:33 -0400)
If an iprop slave tries to load a dump from the master and it fails,
reset the ulog header so we take another full dump, instead of
reporting that the slave is current when it isn't.

[ghudson@mit.edu: commit message]
[tlyu@mit.edu: remove ulog_sync_header call]

(cherry picked from commit 74b3f961e15d2eee5bad93d2a224c10834bbaab8)

ticket: 7607 (new)
version_fixed: 1.10.5
status: resolved

src/kadmin/dbutil/dump.c

index 2473f48b565cb4260966e7ea7d6e972d97941e1d..2fba01fd57b60f0bff2802d74c75a4d0a043dc45 100644 (file)
@@ -2653,6 +2653,18 @@ error:
      */
     if (!(flags & FLAG_UPDATE)) {
         if (exit_status) {
+
+           /* Re-init ulog so we don't accidentally think we are current */
+            if (log_ctx && log_ctx->iproprole) {
+                log_ctx->ulog->kdb_last_sno = 0;
+                log_ctx->ulog->kdb_last_time.seconds = 0;
+                log_ctx->ulog->kdb_last_time.useconds = 0;
+
+                log_ctx->ulog->kdb_first_sno = 0;
+                log_ctx->ulog->kdb_first_time.seconds = 0;
+                log_ctx->ulog->kdb_first_time.useconds = 0;
+            }
+
             kret = krb5_db_destroy(kcontext, db5util_db_args);
             /*
              * Ignore a not supported error since there is nothing to do about