]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
When listing master key versions, if none of them appears to be active
authorKen Raeburn <raeburn@mit.edu>
Thu, 29 Jan 2009 23:47:47 +0000 (23:47 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 29 Jan 2009 23:47:47 +0000 (23:47 +0000)
(can currently happen in certain time-warp cases), print a message to
that effect and keep going with the listing.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/mkey_migrate@21834 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/dbutil/kdb5_mkey.c

index 18667feae5e7e041d0dbec67be726b8dd7da0e27..1be680005b4c35d38429807169c3e676d6236f6a 100644 (file)
@@ -467,7 +467,8 @@ kdb5_use_mkey(int argc, char *argv[])
 
     retval = krb5_dbe_lookup_actkvno(util_context, &master_entry, &actkvno_list);
     if (retval != 0) {
-        com_err(progname, retval, "while setting up master key name");
+        com_err(progname, retval,
+                "while looking up active version of master key");
         exit_status++;
         return;
     }
@@ -628,8 +629,14 @@ kdb5_list_mkeys(int argc, char *argv[])
     } else {
         retval = krb5_dbe_find_act_mkey(util_context, master_keylist,
                                         actkvno_list, &act_kvno, &act_mkey);
-        if (retval != 0) {
-            com_err(progname, retval, "while setting up master key name");
+        if (retval == KRB5_KDB_NOACTMASTERKEY) {
+            /* Maybe we went through a time warp, and the only keys
+               with activation dates have them set in the future?  */
+            com_err(progname, retval, "");
+            /* Keep going.  */
+            act_kvno = -1;
+        } else if (retval != 0) {
+            com_err(progname, retval, "while looking up active master key");
             exit_status++;
             return;
         }