Skip Menu |
 

Subject: Incorrect type of saddr_len causes error in 64 bit environment
Download (untitled) / with headers
text/plain 1.5KiB
While testing kerberos client in 64 bit environment, kdcd was failing to
come up. On investigation, it was found that the recvfrom() called in
64 bit environment was able to receive the data but not able to get
the address structure filled from which the data is received because the
saddr_len pointer is a 64 bit pointer in 64 bit environment but the api
expects a 32 bit pointer.

Fix:
Change he saddr_len is changed to int type pointer.

Files affected:
<krbpath>/src/kdc/network.c
<krbpath>/src/kadmin/server/ovsec_kadmd.c

Diffs:
*** /krb5-1.4.1/src/kdc/network.c
--- /krb5-1.4.1/src/kdc/network.c.fix

*** 703,709 ****
int selflags)
{
int cc;
! socklen_t saddr_len;
krb5_fulladdr faddr;
krb5_error_code retval;
struct sockaddr_storage saddr;
--- 703,710 ----
int selflags)
{
int cc;
! //Changed to fix the 64 bit failure due to mismatch between saddr_len
and recvfrom prototype
! int saddr_len;
krb5_fulladdr faddr;
krb5_error_code retval;
struct sockaddr_storage saddr;


***********************************************************************

*** /krb5-1.4.1/src/kadmin/server/ovsec_kadmd.c
--- /krb5-1.4.1/src/kadmin/server/ovsec_kadmd.c.fix

*** 1076,1082 ****
char req[1500];
int len;
struct sockaddr_in from;
! socklen_t fromlen;
krb5_keytab kt;
krb5_data reqdata, repdata;
int s2;
--- 1076,1082 ----
char req[1500];
int len;
struct sockaddr_in from;
! int fromlen;
krb5_keytab kt;
krb5_data reqdata, repdata;
int s2;
Show quoted text
> While testing kerberos client in 64 bit environment, kdcd was failing to
> come up. On investigation, it was found that the recvfrom() called in
> 64 bit environment was able to receive the data but not able to get
> the address structure filled from which the data is received because the
> saddr_len pointer is a 64 bit pointer in 64 bit environment but the api
> expects a 32 bit pointer.

Is this because we synthesize an incorrect definition for socklen_t, or
does the 64-bit environment not conform to the SUSv2 and POSIX 2004?

Ken