* dump.c (load_db): Call krb5_db_promote instead of krb5_db_fini
authorKen Raeburn <raeburn@mit.edu>
Fri, 30 Jun 2006 21:07:25 +0000 (21:07 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 30 Jun 2006 21:07:25 +0000 (21:07 +0000)
ticket: 3964
status: open

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

src/kadmin/dbutil/dump.c

index f491ae70f95d7569e47b068bba5c2df8418621de..5df6e73c5f05c7a79874028b2957b034f1c395de 100644 (file)
@@ -2303,14 +2303,24 @@ load_db(argc, argv)
         exit_status++;
     }
 
+#if 0
     if ((kret = krb5_db_fini(kcontext))) {
         fprintf(stderr, close_err_fmt,
                 programname, error_message(kret));
         exit_status++;
     }
+#endif
 
     /* close policy db below */
 
+    if (exit_status == 0
+       && !update
+       && (kret = krb5_db_promote(kcontext, db5util_db_args))) {
+       fprintf(stderr, "%s: cannot make newly loaded database live (%s)\n",
+               programname, error_message(kret));
+       exit_status++;
+    }
+
 error:
     /*
      * If not an update: if there was an error, destroy the temp database,