Make sure ulog_map() is invoked whenever we open the database in
authorGreg Hudson <ghudson@mit.edu>
Sun, 27 Feb 2011 02:35:04 +0000 (02:35 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sun, 27 Feb 2011 02:35:04 +0000 (02:35 +0000)
kdb5_util.  Fixes all of the master key rollover commands in the
presence of iprop.  Reported by kacarstensen@csupomona.edu.

ticket: 6875
tags: pullup
target_version: 1.9.1

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24667 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/dbutil/dump.c
src/kadmin/dbutil/kdb5_util.c

index 96d1a13c4786cf5c8a144fac8ef05f53543557c1..9f1a1691f34904e8bd95016b24822f3cad38b6cf 100644 (file)
@@ -1283,14 +1283,6 @@ dump_db(argc, argv)
         fprintf(arglist.ofile, "%s", dump->header);
 
         if (dump_sno) {
-            if (ulog_map(util_context, global_params.iprop_logfile,
-                         global_params.iprop_ulogsize, FKCOMMAND, db_args)) {
-                fprintf(stderr,
-                        _("%s: Could not map log\n"), progname);
-                exit_status++;
-                goto unlock_and_return;
-            }
-
             /*
              * We grab the lock twice (once again in the iterator call),
              * but that's ok since the lock func handles incr locks held.
index 6c8e364c611ba6ae3bbbbc25c4b2624d4438242d..11b1a558f54af47b044ecb0e0efaffa5ae3b4d7d 100644 (file)
@@ -499,6 +499,17 @@ static int open_db_and_mkey()
         return(1);
     }
 
+    if (global_params.iprop_enabled) {
+        if (ulog_map(util_context, global_params.iprop_logfile,
+                     global_params.iprop_ulogsize, FKCOMMAND,
+                     db5util_db_args)) {
+            fprintf(stderr, _("%s: Could not map log\n"),
+                    progname);
+            exit_status++;
+            return(1);
+        }
+    }
+
     valid_master_key = 1;
     dbactive = TRUE;
     return 0;