[11506] in Kerberos-V5-bugs
[krbdev.mit.edu #6706] Re: Small kdc/kdc_preauth.c mods for your
daemon@ATHENA.MIT.EDU (Jeff Blaine via RT)
Fri Apr 23 15:40:03 2010
Mail-followup-to: rt@krbdev.mit.edu
mail-copies-to: never
From: "Jeff Blaine via RT" <rt-comment@krbdev.MIT.EDU>
In-Reply-To: <rt-6706@krbdev.mit.edu>
Message-ID: <rt-6706-32743.16.480105673563@krbdev.mit.edu>
To: "'AdminCc of krbdev.mit.edu Ticket #6706'":;"'AdminCc of krbdev.mit.edu Ticket #6706'":;@MIT.EDU
Date: Fri, 23 Apr 2010 15:39:58 -0400 (EDT)
Reply-To: rt-comment@krbdev.MIT.EDU
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krb5-bugs-bounces@mit.edu
Actually, this is better. Ditch the 1st diff and consider
this one instead.
I will take more care with future efforts.
* Log the valid preauth methods
* Use NULL instead of '0' per calloc/malloc man page
* Log a not enough memory message if needed, since this
function does not return krb5_error_code
* Set length to 0, not NULL, fixed gcc warning
--- ../../PRISTINE-DONT-MOD-krb5-1.8/src/kdc/kdc_preauth.c 2010-02-12
15:28:39.000000000 -0500
+++ kdc/kdc_preauth.c 2010-04-23 12:36:15.000000000 -0400
@@ -562,6 +562,10 @@
free(kdc_realm_names);
n_preauth_systems = k;
/* Add the end-of-list marker. */
+ for (i = 0; i < k; i++) {
+ krb5_klog_syslog (LOG_INFO, "preauth method %s valid",
+ preauth_systems[i].name);
+ }
preauth_systems[k].name = "[end]";
preauth_systems[k].type = -1;
return 0;
@@ -1006,8 +1010,11 @@
hw_only = isflagset(client->attributes, KRB5_KDB_REQUIRES_HW_AUTH);
/* Allocate two extra entries for the cookie and the terminator. */
pa_data = calloc(n_preauth_systems + 2, sizeof(krb5_pa_data *));
- if (pa_data == 0)
+ if (pa_data == NULL) {
+ krb5_klog_syslog (LOG_INFO,
+ "Not enough memory in get_preauth_hint_list");
return;
+ }
pa = pa_data;
for (ap = preauth_systems; ap->type != -1; ap++) {
@@ -1328,7 +1335,7 @@
}
key_modified = FALSE;
null_item.contents = NULL;
- null_item.length = NULL;
+ null_item.length = 0;
send_pa = send_pa_list;
*send_pa = 0;
_______________________________________________
krb5-bugs mailing list
krb5-bugs@mit.edu
https://mailman.mit.edu/mailman/listinfo/krb5-bugs