[1803] in Kerberos-V5-bugs

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

Krb5 Beta5 defect reports

daemon@ATHENA.MIT.EDU (Sean Mullan)
Tue Feb 13 15:29:32 1996

To: krb5-bugs@MIT.EDU
Cc: mullan_s@apollo.hp.com (Sean Mullan), champine@apollo.hp.com
Date: Tue, 13 Feb 1996 15:29:03 -0500
From: Sean Mullan <mullan_s@apollo.hp.com>


1) src/lib/krb5/os/def_realm.c

Change macro OLD_CONFIG_FILE to OLD_CONFIG_FILES to be consistent
with other files. Diffs:

*** def_realm.c@@/main/mullan_dce_k5_bl1/0       Mon Feb 12 17:39:17 1996
--- def_realm.c  Mon Feb 12 17:39:30 1996
***************
*** 49,55 ****
      krb5_context context;
      char **lrealm;
  {
! #ifdef OLD_CONFIG_FILE
      FILE *config_file;
      char realmbuf[BUFSIZ];
  #endif
--- 49,55 ----
      krb5_context context;
      char **lrealm;
  {
! #ifdef OLD_CONFIG_FILES
      FILE *config_file;
      char realmbuf[BUFSIZ];
  #endif
***************
*** 60,66 ****
            return KV5M_CONTEXT;
  
      if (!context->default_realm) {
! #ifdef OLD_CONFIG_FILE
            krb5_find_config_files();
            if (!(config_file = fopen(krb5_config_file, "r")))
                    /* can't open */
--- 60,66 ----
            return KV5M_CONTEXT;
  
      if (!context->default_realm) {
! #ifdef OLD_CONFIG_FILES
            krb5_find_config_files();
            if (!(config_file = fopen(krb5_config_file, "r")))
                    /* can't open */


2) src/lib/krb5/os/locate_kdc.c

krb5_locate_kdc() should call krb5_get_krbhst() to get the KDC server.
This will then look in the old or new config files based on the macro
OLD_CONFIG_FILES. As it is now, it is not backwards compatible and
will only look in the new config file. Diffs:

*** ../../../../../../krb5/src/lib/krb5/os/locate_kdc.c@@/main/mullan_dce_k5_bl1/0      Tue Feb 13 11:24:07 1996
--- locate_kdc.c        Tue Feb 13 15:06:59 1996
***************
*** 39,46 ****
      struct sockaddr **addr_pp;
      int *naddrs;
  {
!     const char        *realm_kdc_names[4];
!     char **hostlist, *host, *port, *cp;
      krb5_error_code code;
      int i, j, out, count;
      struct sockaddr *addr_p;
--- 39,45 ----
      struct sockaddr **addr_pp;
      int *naddrs;
  {
!     char **hostlist, *host, *port;
      krb5_error_code code;
      int i, j, out, count;
      struct sockaddr *addr_p;
***************
*** 52,79 ****
      u_short sec_udpport = htons(KRB5_DEFAULT_SEC_PORT);
  #endif
  
!     if ((host = malloc(realm->length + 1)) == NULL) 
!       return ENOMEM;
  
-     strncpy(host, realm->data, realm->length);
-     host[realm->length] = '\0';
-     hostlist = 0;
-     
-     realm_kdc_names[0] = "realms";
-     realm_kdc_names[1] = host;
-     realm_kdc_names[2] = "kdc";
-     realm_kdc_names[3] = 0;
- 
-     code = profile_get_values(context->profile, realm_kdc_names, &hostlist);
-     krb5_xfree(host);
- 
-     if (code == PROF_NO_SECTION)
-       return KRB5_REALM_UNKNOWN;
-     if (code == PROF_NO_RELATION)
-       return KRB5_CONFIG_BADFORMAT;
-     if (code)
-       return code;
- 
  #ifdef KRB5_USE_INET
      if (sp = getservbyname(KDC_PORTNAME, "udp"))
        udpport = sp->s_port;
--- 51,59 ----
      u_short sec_udpport = htons(KRB5_DEFAULT_SEC_PORT);
  #endif
  
!     if (code = krb5_get_krbhst(context, realm, &hostlist))
!       return(code);
  
  #ifdef KRB5_USE_INET
      if (sp = getservbyname(KDC_PORTNAME, "udp"))
        udpport = sp->s_port;
***************
*** 101,115 ****
  
      for (i=0, out=0; hostlist[i]; i++) {
        host = hostlist[i];
-       /*
-        * Strip off excess whitespace
-        */
-       cp = strchr(host, ' ');
-       if (cp)
-           *cp = 0;
-       cp = strchr(host, '\t');
-       if (cp)
-           *cp = 0;
        port = strchr(host, ':');
        if (port) {
            *port = 0;
--- 81,86 ----


************************************************************
Sean Mullan                    Phone: (508) 436-4129
Hewlett-Packard Co.         Internet: mullan_s@apollo.hp.com
300 Apollo Drive                 Fax: (508) 436-5140
Chelmsford, MA 01824
************************************************************

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