summaryrefslogtreecommitdiffstats
path: root/krb5-kvno-230379.patch
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@dahyabhai.net>2012-01-30 19:49:10 -0500
committerNalin Dahyabhai <nalin@dahyabhai.net>2012-01-30 19:49:10 -0500
commit9e5f5995cd6a29944fa6ddaf5de07353c476ba69 (patch)
tree8cb5ac08240f22fdf0fa2c6c992f9242fac9dae9 /krb5-kvno-230379.patch
parent6ac0d24fa5ac44d6d258c43f69c6a1863ea00fd0 (diff)
downloadkrb5-9e5f5995cd6a29944fa6ddaf5de07353c476ba69.tar.gz
krb5-9e5f5995cd6a29944fa6ddaf5de07353c476ba69.tar.xz
krb5-9e5f5995cd6a29944fa6ddaf5de07353c476ba69.zip
- add patch to accept keytab entries with vno==0 as matches when we're searching for an entry with a specific name/kvno (#230382/#782211,RT#3349)krb5-1.10-2.fc17
Diffstat (limited to 'krb5-kvno-230379.patch')
-rw-r--r--krb5-kvno-230379.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/krb5-kvno-230379.patch b/krb5-kvno-230379.patch
new file mode 100644
index 0000000..ea9b69f
--- /dev/null
+++ b/krb5-kvno-230379.patch
@@ -0,0 +1,53 @@
+From patch attached to http://krbdev.mit.edu/rt/Ticket/Display.html?id=3349,
+at http://krbdev.mit.edu/rt/Ticket/Attachment/23851/13214/kvno.diff, adjusted
+as needed to apply to 1.10. FIXME: I'd like to better handle cases where we
+have a new key with the right version stored later in the keytab file.
+Currently, we're setting up to overlook that possibility.
+
+Note that this only affects the path taken when krb5_rd_rep() is passed a
+server principal name, as without a server principal name it already tries
+all of the keys it finds in the keytab, regardless of version numbers.
+
+Index: krb5/src/kadmin/ktutil/ktutil.c
+===================================================================
+--- krb5/src/kadmin/ktutil/ktutil.c (revision 3367)
++++ krb5/src/kadmin/ktutil/ktutil.c (working copy)
+@@ -155,7 +155,7 @@
+ char *princ = NULL;
+ char *enctype = NULL;
+ krb5_kvno kvno = 0;
+- int use_pass = 0, use_key = 0, i;
++ int use_pass = 0, use_key = 0, use_kvno = 0, i;
+
+ for (i = 1; i < argc; i++) {
+ if ((strlen(argv[i]) == 2) && !strncmp(argv[i], "-p", 2)) {
+@@ -164,6 +164,7 @@
+ }
+ if ((strlen(argv[i]) == 2) && !strncmp(argv[i], "-k", 2)) {
+ kvno = (krb5_kvno) atoi(argv[++i]);
++ use_kvno++;
+ continue;
+ }
+ if ((strlen(argv[i]) == 2) && !strncmp(argv[i], "-e", 2)) {
+@@ -180,7 +181,7 @@
+ }
+ }
+
+- if (argc != 8 || !(princ && kvno && enctype) || (use_pass+use_key != 1)) {
++ if (argc != 8 || !(princ && use_kvno && enctype) || (use_pass+use_key != 1)) {
+ fprintf(stderr, _("usage: %s (-key | -password) -p principal "
+ "-k kvno -e enctype\n"), argv[0]);
+ return;
+Index: krb5/src/lib/krb5/keytab/kt_file.c
+===================================================================
+--- krb5/src/lib/krb5/keytab/kt_file.c (revision 3367)
++++ krb5/src/lib/krb5/keytab/kt_file.c (working copy)
+@@ -349,7 +349,7 @@
+ higher than that. Short-term workaround: only compare
+ the low 8 bits. */
+
+- if (new_entry.vno == (kvno & 0xff)) {
++ if (new_entry.vno == (kvno & 0xff) || new_entry.vno == IGNORE_VNO) {
+ krb5_kt_free_entry(context, &cur_entry);
+ cur_entry = new_entry;
+ break;