[2760] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

pending/447: krb5-nt-alhpa2 fix for multiple local addrs

daemon@ATHENA.MIT.EDU (John Brezak)
Tue Jul 22 13:52:27 1997

Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: gnats-admin@rt-11.MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU, John Brezak <brezak@apollo.hp.com>
Date: Tue, 22 Jul 1997 13:49:06 -0400
From: John Brezak <brezak@apollo.hp.com>
To: krb5-bugs@MIT.EDU


>Number:         447
>Category:       pending
>Synopsis:       krb5-nt-alhpa2 fix for multiple local addrs
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Tue Jul 22 13:50:00 EDT 1997
>Last-Modified:
>Originator:
>Organization:
>Release:
>Environment:
>Description:
>How-To-Repeat:
>Fix:
>Audit-Trail:
>Unformatted:
--=====================_869608146==_
Content-Type: text/plain; charset="us-ascii"

Here is fix for win32 to use all local addresses for the initial TGT request.


--=====================_869608146==_
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: attachment; filename="c_localaddr.c.diff"

*** c_localaddr.c~	Wed Jun 12 06:15:12 1996
--- c_localaddr.c	Tue Jul 22 02:34:46 1997
***************
*** 249,255 ****
  krb5_crypto_os_localaddr (krb5_address ***addr) {
      char host[64];                              /* Name of local machine */
      struct hostent *hostrec;
!     int err;
  
      *addr = calloc (2, sizeof (krb5_address *));
      if (*addr == NULL)
--- 249,256 ----
  krb5_crypto_os_localaddr (krb5_address ***addr) {
      char host[64];                              /* Name of local machine */
      struct hostent *hostrec;
!     int err, j;
!     int count = 1;
      
      *addr = calloc (2, sizeof (krb5_address *));
      if (*addr == NULL)
***************
*** 270,294 ****
      }
  #endif /* HAVE_MACSOCK_H */
  
!     (*addr)[0] = calloc (1, sizeof(krb5_address));
!     if ((*addr)[0] == NULL) {
          free (*addr);
          return ENOMEM;
      }
!     (*addr)[0]->magic = KV5M_ADDRESS;
!     (*addr)[0]->addrtype = hostrec->h_addrtype;
!     (*addr)[0]->length = hostrec->h_length;
!     (*addr)[0]->contents = (unsigned char *)malloc((*addr)[0]->length);
!     if (!(*addr)[0]->contents) {
!         free((*addr)[0]);
          free(*addr);
          return ENOMEM;
      } else {
!         memcpy ((*addr)[0]->contents,
!                 hostrec->h_addr,
                  (*addr)[0]->length);
      }
! 	/* FIXME, deal with the case where gethostent returns multiple addrs */
  
      return(0);
  }
--- 271,309 ----
      }
  #endif /* HAVE_MACSOCK_H */
  
!     /*printf("hostname=\"%s\"\n", host);*/
! 
!     for (j = 0; hostrec->h_addr_list[j]; j++) {
! 
! 	/*printf("\t[%d > %d] ", j, count);*/
! 	
! 	if (j >= count) {
! 	    *addr = realloc (*addr, (++count+1) * sizeof (krb5_address *));
! 	    if (*addr == NULL)
! 		return ENOMEM;
! 	    (*addr)[count] = NULL;
! 	}
! 
! 	(*addr)[j] = calloc (1, sizeof(krb5_address));
! 	if ((*addr)[j] == NULL) {
  	    free (*addr);
  	    return ENOMEM;
  	}
! 	(*addr)[j]->magic = KV5M_ADDRESS;
! 	(*addr)[j]->addrtype = hostrec->h_addrtype;
! 	(*addr)[j]->length = hostrec->h_length;
! 	(*addr)[j]->contents = (unsigned char *)malloc((*addr)[j]->length);
! 	if (!(*addr)[j]->contents) {
! 	    free((*addr)[j]);
  	    free(*addr);
  	    return ENOMEM;
  	} else {
! 	    memcpy ((*addr)[j]->contents,
! 		    hostrec->h_addr_list[j],
  		    (*addr)[0]->length);
  	}
! 	/*printf("%s\n", inet_ntoa(*(struct in_addr *)((*addr)[j]->contents)));*/
!     }
  
      return(0);
  }

--=====================_869608146==_
Content-Type: text/plain; charset="us-ascii"



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 John Brezak                    Internet: brezak@ch.hp.com
 Hewlett Packard/Apollo         Phone:    (508) 436-4915
 300 Apollo Drive               Fax:      (508) 436-5140
 Chelmsford, Massachusetts, USA

--=====================_869608146==_--


home help back first fref pref prev next nref lref last post