From: rbasch Date: Mon, 4 Mar 2013 03:55:41 +0000 (-0500) Subject: Reset ulog if database load failed X-Git-Tag: krb5-1.9.5-final~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89ed3c66a43e7440ceb7438332739adaf7401bb9;p=thirdparty%2Fkrb5.git Reset ulog if database load failed 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) (cherry picked from commit 9fae7b50c7217e6aa88a97b762297e30040b2b86) ticket: 7624 (new) version_fixed: 1.9.5 status: resolved --- diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c index 9c910248ca..17d8bd3cf7 100644 --- a/src/kadmin/dbutil/dump.c +++ b/src/kadmin/dbutil/dump.c @@ -2690,6 +2690,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