From 4be5bf40e4879c5214382d38542db4cf5f57a7d0 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sun, 11 Mar 2001 03:04:59 +0000 Subject: [PATCH] * init_ctx.c: Provide a full prototype for init_common() * recvauth.c (recvauth_common): Declare recvauth_common as static. * parse.c, sendauth.c: Changes to prevent shadowing of local variables. * get_in_tkt.c, tgtname.c: Include int-proto.h for prototypes. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13073 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 11 +++++++++++ src/lib/krb5/krb/get_in_tkt.c | 1 + src/lib/krb5/krb/init_ctx.c | 2 +- src/lib/krb5/krb/parse.c | 6 +++--- src/lib/krb5/krb/recvauth.c | 2 +- src/lib/krb5/krb/sendauth.c | 16 +++++++++------- src/lib/krb5/krb/tgtname.c | 1 + 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 73d92914a..a76e2704a 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,14 @@ +2001-03-10 Ezra Peisach + + * init_ctx.c: Provide a full prototype for init_common(). + + * recvauth.c (recvauth_common): Declare recvauth_common as static. + + * parse.c, sendauth.c: Changes to prevent shadowing of local + variables. + + * get_in_tkt.c, tgtname.c: Include int-proto.h for prototypes. + 2001-03-03 Ken Raeburn * preauth2.c (pa_sam): Return an error if no prompter was diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index 9bd469c2e..60701ff05 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -30,6 +30,7 @@ #include #include "k5-int.h" +#include "int-proto.h" /* All-purpose initial ticket routine, usually called via diff --git a/src/lib/krb5/krb/init_ctx.c b/src/lib/krb5/krb/init_ctx.c index b04cd971f..7654da621 100644 --- a/src/lib/krb5/krb/init_ctx.c +++ b/src/lib/krb5/krb/init_ctx.c @@ -61,7 +61,7 @@ extern krb5_error_code krb5_vercheck(); extern void krb5_win_ccdll_load(krb5_context context); #endif -static krb5_error_code init_common (); +static krb5_error_code init_common (krb5_context *, krb5_boolean); KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_init_context(context) diff --git a/src/lib/krb5/krb/parse.c b/src/lib/krb5/krb/parse.c index 366f75447..508383cbb 100644 --- a/src/lib/krb5/krb/parse.c +++ b/src/lib/krb5/krb/parse.c @@ -217,9 +217,9 @@ krb5_parse_name(context, name, nprincipal) krb5_princ_set_realm_length(context, principal, realmsize); krb5_princ_set_realm_data(context, principal, tmpdata); for (i=0; i < components; i++) { - char *tmpdata = + char *tmpdata2 = malloc(krb5_princ_component(context, principal, i)->length + 1); - if (!tmpdata) { + if (!tmpdata2) { for (i--; i >= 0; i--) krb5_xfree(krb5_princ_component(context, principal, i)->data); krb5_xfree(krb5_princ_realm(context, principal)->data); @@ -227,7 +227,7 @@ krb5_parse_name(context, name, nprincipal) krb5_xfree(principal); return(ENOMEM); } - krb5_princ_component(context, principal, i)->data = tmpdata; + krb5_princ_component(context, principal, i)->data = tmpdata2; krb5_princ_component(context, principal, i)->magic = KV5M_DATA; } diff --git a/src/lib/krb5/krb/recvauth.c b/src/lib/krb5/krb/recvauth.c index f74041c59..2aed962da 100644 --- a/src/lib/krb5/krb/recvauth.c +++ b/src/lib/krb5/krb/recvauth.c @@ -37,7 +37,7 @@ static char *sendauth_version = "KRB5_SENDAUTH_V1.0"; -krb5_error_code +static krb5_error_code recvauth_common(krb5_context context, krb5_auth_context FAR * auth_context, /* IN */ diff --git a/src/lib/krb5/krb/sendauth.c b/src/lib/krb5/krb/sendauth.c index b19afdb7e..ce2463bfc 100644 --- a/src/lib/krb5/krb/sendauth.c +++ b/src/lib/krb5/krb/sendauth.c @@ -158,18 +158,20 @@ krb5_sendauth(context, auth_context, not to guarantee randomness, but to make it less likely that multiple sessions could pick the same subkey. */ char rnd_data[1024]; - size_t len; + size_t len2; krb5_data d; d.length = sizeof (rnd_data); d.data = rnd_data; - len = sizeof (rnd_data); - if (getpeername (*(int*)fd, (struct sockaddr *) rnd_data, &len) == 0) { - d.length = len; + len2 = sizeof (rnd_data); + if (getpeername (*(int*)fd, (struct sockaddr *) rnd_data, + &len2) == 0) { + d.length = len2; (void) krb5_c_random_seed (context, &d); } - len = sizeof (rnd_data); - if (getsockname (*(int*)fd, (struct sockaddr *) rnd_data, &len) == 0) { - d.length = len; + len2 = sizeof (rnd_data); + if (getsockname (*(int*)fd, (struct sockaddr *) rnd_data, + &len2) == 0) { + d.length = len2; (void) krb5_c_random_seed (context, &d); } } diff --git a/src/lib/krb5/krb/tgtname.c b/src/lib/krb5/krb/tgtname.c index 2f7168656..1c759e380 100644 --- a/src/lib/krb5/krb/tgtname.c +++ b/src/lib/krb5/krb/tgtname.c @@ -28,6 +28,7 @@ */ #include "k5-int.h" +#include "int-proto.h" /* This is an internal-only function, used by krb5_get_cred_from_kdc() */ -- 2.26.2