[krbdev.mit.edu #3141] Incorrect type of saddr_len causes error in 64 bit environment

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[krbdev.mit.edu #3141] Incorrect type of saddr_len causes error in 64 bit environment

Greg Hudson via RT
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;


_______________________________________________
krb5-bugs mailing list
[hidden email]
https://mailman.mit.edu/mailman/listinfo/krb5-bugs