diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/kdb_log.h | 1 | ||||
-rw-r--r-- | src/kadmin/dbutil/dump.c | 10 | ||||
-rw-r--r-- | src/lib/kdb/kdb_log.c | 7 |
3 files changed, 8 insertions, 10 deletions
diff --git a/src/include/kdb_log.h b/src/include/kdb_log.h index 88f0eb590e..16d8af2c66 100644 --- a/src/include/kdb_log.h +++ b/src/include/kdb_log.h @@ -50,7 +50,6 @@ extern "C" { #define FKPROPLOG 2 #define FKPROPD 3 #define FKCOMMAND 4 /* Includes kadmin.local and kdb5_util */ -#define FKLOAD 5 /* kdb5_util load */ /* * Default ulog file attributes 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. */ diff --git a/src/lib/kdb/kdb_log.c b/src/lib/kdb/kdb_log.c index c988dcbceb..1fd798e5f6 100644 --- a/src/lib/kdb/kdb_log.c +++ b/src/lib/kdb/kdb_log.c @@ -415,11 +415,6 @@ ulog_init_header(krb5_context context) * * Create and initialize if need be, map as MAP_SHARED. * - * - FKLOAD - * - * Create if need be, initialize (even if the ulog was already present), map - * as MAP_SHARED. (Intended for kdb5_util load of iprop dump.) - * * - FKCOMMAND * * Create and [re-]initialize if need be, size appropriately, map as @@ -513,7 +508,7 @@ ulog_map(krb5_context context, const char *logname, uint32_t ulogentries, return KRB5_LOG_CORRUPT; } - if (ulog->kdb_hmagic != KDB_ULOG_HDR_MAGIC || caller == FKLOAD) { + if (ulog->kdb_hmagic != KDB_ULOG_HDR_MAGIC) { reset_header(ulog); if (caller != FKPROPLOG) ulog_sync_header(ulog); |