From b9bde382b38aba7823a008759b0b88b6c7a68966 Mon Sep 17 00:00:00 2001 From: Thorsten Lockert Date: Thu, 14 Dec 1995 08:43:57 +0000 Subject: Do not use hardcoded realm or host names --- kerberosIV/kprop/kprop.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'kerberosIV/kprop') diff --git a/kerberosIV/kprop/kprop.c b/kerberosIV/kprop/kprop.c index 426a05afc23..b0d6a58aa8d 100644 --- a/kerberosIV/kprop/kprop.c +++ b/kerberosIV/kprop/kprop.c @@ -1,4 +1,4 @@ -/* $Id: kprop.c,v 1.1 1995/12/14 06:52:49 tholo Exp $ */ +/* $Id: kprop.c,v 1.2 1995/12/14 08:43:48 tholo Exp $ */ /*- * Copyright 1987 by the Massachusetts Institute of Technology. @@ -126,6 +126,7 @@ int get_slaves(struct slave_host **psl, char *file, time_t ok_mtime) static int prop_to_slaves(struct slave_host *sl, int fd, char *fslv) { + char *dot, admin[MAXHOSTNAMELEN]; char buf[KPROP_BUFSIZ]; char obuf[KPROP_BUFSIZ + 64 /* leave room for private msg overhead */ ]; struct servent *sp; @@ -215,11 +216,18 @@ prop_to_slaves(struct slave_host *sl, int fd, char *fslv) /* copy it to make sure gethostbyname static doesn't * screw us. */ strcpy (kprop_service_instance, p_my_host_name); + + if (krb_get_admhst(admin, my_realm, 1) != KSUCCESS) { + fprintf (stderr, "Could not get admin host.\n"); + break; + } + if ((dot = strchr(admin, '.')) != NULL) + *dot = '\0'; kerror = krb_get_svc_in_tkt (KPROP_SERVICE_NAME, #if 0 kprop_service_instance, #else - KRB_MASTER, + admin, #endif my_realm, TGT_SERVICE_NAME, -- cgit v1.2.3