diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1995-12-14 08:43:57 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1995-12-14 08:43:57 +0000 |
commit | b9bde382b38aba7823a008759b0b88b6c7a68966 (patch) | |
tree | 2df6948320f675f2f3b178831a2c18f8062fc4d3 /kerberosIV/kprop | |
parent | 51285176beb2daf7fedfbdc3f22cb775c29ef5af (diff) |
Do not use hardcoded realm or host names
Diffstat (limited to 'kerberosIV/kprop')
-rw-r--r-- | kerberosIV/kprop/kprop.c | 12 |
1 files changed, 10 insertions, 2 deletions
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, |