From: Ezra Peisach Date: Mon, 30 Jul 2001 21:36:34 +0000 (+0000) Subject: * sendauth.c (krb5_sendauth): Instead of casting second argument X-Git-Tag: krb5-1.3-alpha1~1155 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4b6bdc7bd151cff8ae6926f46547afc2e73df02c;p=krb5.git * sendauth.c (krb5_sendauth): Instead of casting second argument to getpeername() and getsockname() to "struct sockaddr *", cast to system specific type as determined by autoconf. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13656 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 493e92c3e..4ca2bbe31 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,9 @@ +2001-07-30 Ezra Peisach + + * sendauth.c (krb5_sendauth): Instead of casting second argument + to getpeername() and getsockname() to "struct sockaddr *", cast to + system specific type as determined by autoconf. + 2001-07-24 Ezra Peisach * in_tkt_sky.c (krb5_get_in_tkt_with_skey): Change cast from diff --git a/src/lib/krb5/krb/sendauth.c b/src/lib/krb5/krb/sendauth.c index ce2463bfc..62c679495 100644 --- a/src/lib/krb5/krb/sendauth.c +++ b/src/lib/krb5/krb/sendauth.c @@ -36,6 +36,19 @@ #include #include +#ifndef GETPEERNAME_ARG2_TYPE +#define GETPEERNAME_ARG2_TYPE struct sockaddr +#endif +#ifndef GETPEERNAME_ARG3_TYPE +#define GETPEERNAME_ARG3_TYPE size_t +#endif +#ifndef GETSOCKNAME_ARG2_TYPE +#define GETSOCKNAME_ARG2_TYPE struct sockaddr +#endif +#ifndef GETSOCKNAME_ARG3_TYPE +#define GETSOCKNAME_ARG3_TYPE size_t +#endif + static char *sendauth_version = "KRB5_SENDAUTH_V1.0"; KRB5_DLLIMP krb5_error_code KRB5_CALLCONV @@ -158,18 +171,18 @@ 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 len2; + GETPEERNAME_ARG3_TYPE len2; krb5_data d; d.length = sizeof (rnd_data); d.data = rnd_data; len2 = sizeof (rnd_data); - if (getpeername (*(int*)fd, (struct sockaddr *) rnd_data, + if (getpeername (*(int*)fd, (GETPEERNAME_ARG2_TYPE *) rnd_data, &len2) == 0) { d.length = len2; (void) krb5_c_random_seed (context, &d); } len2 = sizeof (rnd_data); - if (getsockname (*(int*)fd, (struct sockaddr *) rnd_data, + if (getsockname (*(int*)fd, (GETSOCKNAME_ARG2_TYPE *) rnd_data, &len2) == 0) { d.length = len2; (void) krb5_c_random_seed (context, &d);