summaryrefslogtreecommitdiffstats
path: root/src/kadmin
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2014-01-23 10:51:21 -0500
committerGreg Hudson <ghudson@mit.edu>2014-02-05 00:21:30 -0500
commit1c0507df449ded505f54383387032db2723bd871 (patch)
tree57e195a53d89bb82958309f1b05cc0f4d417e85e /src/kadmin
parent779a335f4e2deb2d76caf7d0dd3de847a040c050 (diff)
downloadkrb5-1c0507df449ded505f54383387032db2723bd871.tar.gz
krb5-1c0507df449ded505f54383387032db2723bd871.tar.xz
krb5-1c0507df449ded505f54383387032db2723bd871.zip
In kdb5_util load, init ulog closer to promote
Always map the ulog with FKCOMMAND, not FKLOAD which reinitializes the ulog. Don't reinitialize the ulog until just before calling krb5_db_promote(). Get rid of FKLOAD since it isn't needed any more; we can just call ulog_init_header() manually.
Diffstat (limited to 'src/kadmin')
-rw-r--r--src/kadmin/dbutil/dump.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c
index e180f69152..ab96ca724f 100644
--- a/src/kadmin/dbutil/dump.c
+++ b/src/kadmin/dbutil/dump.c
@@ -1485,7 +1485,7 @@ load_db(int argc, char **argv)
kdb_log_context *log_ctx;
krb5_boolean db_locked = FALSE, temp_db_created = FALSE;
krb5_boolean verbose = FALSE, update = FALSE, iprop_load = FALSE;
- uint32_t caller = FKCOMMAND, last_sno, last_seconds, last_useconds;
+ uint32_t last_sno, last_seconds, last_useconds;
/* Parse the arguments. */
dbname = global_params.dbname;
@@ -1505,7 +1505,6 @@ load_db(int argc, char **argv)
if (log_ctx && log_ctx->iproprole) {
load = &iprop_version;
iprop_load = TRUE;
- caller = FKLOAD;
} else {
fprintf(stderr, _("Iprop not enabled\n"));
goto error;
@@ -1574,7 +1573,7 @@ load_db(int argc, char **argv)
if (global_params.iprop_enabled &&
ulog_map(util_context, global_params.iprop_logfile,
- global_params.iprop_ulogsize, caller, db5util_db_args)) {
+ global_params.iprop_ulogsize, FKCOMMAND, db5util_db_args)) {
fprintf(stderr, _("Could not open iprop ulog\n"));
goto error;
}
@@ -1648,6 +1647,11 @@ load_db(int argc, char **argv)
}
if (!update) {
+ /* Initialize the ulog header before promoting so we can't leave behind
+ * the pre-load ulog state if we are killed just after promoting. */
+ if (log_ctx != NULL && log_ctx->iproprole)
+ ulog_init_header(util_context);
+
ret = krb5_db_promote(util_context, db5util_db_args);
/* Ignore a not supported error since there is nothing to do about it
* anyway. */