krb5 commit: Simplify kdb5_list_mkeys actkvno list retrieval
Greg Hudson
ghudson at MIT.EDU
Fri Oct 25 11:42:18 EDT 2013
https://github.com/krb5/krb5/commit/0db3c9a631feaf32420d03b76e1d720d64a707a9
commit 0db3c9a631feaf32420d03b76e1d720d64a707a9
Author: Greg Hudson <ghudson at mit.edu>
Date: Thu Oct 24 13:16:54 2013 -0400
Simplify kdb5_list_mkeys actkvno list retrieval
After recent changes, krb5_dbe_lookup_actkvno cannot yield an empty
list and cannot return KRB5_KDB_NOACTMASTERKEY.
src/kadmin/dbutil/kdb5_mkey.c | 46 ++++++++++------------------------------
1 files changed, 12 insertions(+), 34 deletions(-)
diff --git a/src/kadmin/dbutil/kdb5_mkey.c b/src/kadmin/dbutil/kdb5_mkey.c
index 87a1dc3..59bce3c 100644
--- a/src/kadmin/dbutil/kdb5_mkey.c
+++ b/src/kadmin/dbutil/kdb5_mkey.c
@@ -610,22 +610,12 @@ kdb5_list_mkeys(int argc, char *argv[])
goto cleanup_return;
}
- if (actkvno_list == NULL) {
- act_kvno = master_entry->key_data[0].key_data_kvno;
- } else {
- retval = krb5_dbe_find_act_mkey(util_context, actkvno_list, &act_kvno,
- &act_mkey);
- 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++;
- goto cleanup_return;
- }
+ retval = krb5_dbe_find_act_mkey(util_context, actkvno_list, &act_kvno,
+ &act_mkey);
+ if (retval != 0) {
+ com_err(progname, retval, _("while looking up active master key"));
+ exit_status++;
+ goto cleanup_return;
}
printf("Master keys for Principal: %s\n", mkey_fullname);
@@ -640,24 +630,12 @@ kdb5_list_mkeys(int argc, char *argv[])
goto cleanup_return;
}
- if (actkvno_list != NULL) {
- act_time = -1; /* assume actkvno entry not found */
- for (cur_actkvno = actkvno_list; cur_actkvno != NULL;
- cur_actkvno = cur_actkvno->next) {
- if (cur_actkvno->act_kvno == cur_kb_node->kvno) {
- act_time = cur_actkvno->act_time;
- break;
- }
- }
- } else {
- /*
- * mkey princ doesn't have an active knvo list so assume the current
- * key is active now
- */
- if ((retval = krb5_timeofday(util_context, &act_time))) {
- com_err(progname, retval, _("while getting current time"));
- exit_status++;
- goto cleanup_return;
+ act_time = -1; /* assume actkvno entry not found */
+ for (cur_actkvno = actkvno_list; cur_actkvno != NULL;
+ cur_actkvno = cur_actkvno->next) {
+ if (cur_actkvno->act_kvno == cur_kb_node->kvno) {
+ act_time = cur_actkvno->act_time;
+ break;
}
}
More information about the cvs-krb5
mailing list