[7746] in Athena Bugs

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

olc client lib/utils.c: expand_hostname

daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Tue Jul 16 20:19:59 1991

Date: Tue, 16 Jul 91 17:19:18 -0700
From: "Jonathan I. Kamens" <jik@cats.UCSC.EDU>
To: bugs@ATHENA.MIT.EDU


The function expand_hostname is used in olc clients to determine the
kerberos realm to use, if it is not defined.  When the hostname passed
in is an FDQN, it just uses the domain as the kerberos realm; that's
wrong, it should use krb_realmofhost.  Patch follows.

  jik

*** 1.18	1991/04/10 21:56:15
--- utils.c	1991/07/17 00:18:50
***************
*** 275,284 ****
      }
    else
      {
        i = p-hostname;
        (void) strncpy(instance,hostname,i);
        instance[i] = '\0';
!       (void) strcpy(realm, p+1);
      }
  
  #ifdef REALM
--- 275,290 ----
      }
    else
      {
+       char *tmp;
+ 
        i = p-hostname;
        (void) strncpy(instance,hostname,i);
        instance[i] = '\0';
!       tmp = krb_realmofhost(hostname);
!       if (tmp)
! 	(void) strcpy(realm, tmp);
!       else
! 	(void) strcpy(realm, p+1);
      }
  
  #ifdef REALM

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