Instead of passing a 0 to add_new_mkey for kvno and leaving
authorKen Raeburn <raeburn@mit.edu>
Mon, 5 Sep 2011 01:58:48 +0000 (01:58 +0000)
committerKen Raeburn <raeburn@mit.edu>
Mon, 5 Sep 2011 01:58:48 +0000 (01:58 +0000)
new_mkey_kvno (used when stashing) uninitialized, use get_next_kvno to
set the latter to the only non-zero value that add_new_mkey will
accept.

ticket: 6617

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

src/kadmin/dbutil/kdb5_mkey.c

index e5da1927ec5e53fa00f57d13a050cffc5c680841..39529941068677c19e5e9c703a7eaba30844b9c9 100644 (file)
@@ -299,7 +299,9 @@ kdb5_add_mkey(int argc, char *argv[])
         goto cleanup_return;
     }
 
-    retval = add_new_mkey(util_context, master_entry, &new_mkeyblock, 0);
+    new_mkey_kvno = get_next_kvno(util_context, master_entry);
+    retval = add_new_mkey(util_context, master_entry, &new_mkeyblock,
+                          new_mkey_kvno);
     if (retval) {
         com_err(progname, retval,
                 _("adding new master key to master principal"));