summaryrefslogtreecommitdiff
path: root/lib/ZInit.c
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1988-11-14 06:29:34 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1988-11-14 06:29:34 +0000
commit8be15fd30ab70ee7b00c4917d767ef748b220261 (patch)
treed87680cc01150d9bd50a4c62802cdf45466cf2db /lib/ZInit.c
parentfbd6c3a023e7dd0adbc5fd45d0380ae5813512a4 (diff)
use #define'd name for the service
when not KERBEROS, use a pre-defined realm
Diffstat (limited to 'lib/ZInit.c')
-rw-r--r--lib/ZInit.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/ZInit.c b/lib/ZInit.c
index d09e18f..54bbc04 100644
--- a/lib/ZInit.c
+++ b/lib/ZInit.c
@@ -29,9 +29,6 @@ Code_t ZInitialize()
char addr[4];
#ifdef KERBEROS
int krbval;
-#else
- char hostname[MAXHOSTNAMELEN+1];
- struct hostent *hent;
#endif
init_zeph_err_tbl();
@@ -49,7 +46,7 @@ Code_t ZInitialize()
addr[2] = 0;
addr[3] = 1;
- hmserv = (struct servent *)getservbyname("zephyr-hm", "udp");
+ hmserv = (struct servent *)getservbyname(HM_SVCNAME, "udp");
if (!hmserv)
return (ZERR_HMPORT);
@@ -63,12 +60,7 @@ Code_t ZInitialize()
if ((krbval = get_krbrlm(__Zephyr_realm, 1)) != KSUCCESS)
return (krbval);
#else
- if (gethostname(hostname, MAXHOSTNAMELEN))
- return (errno);
- if (hent = gethostbyname(hostname))
- (void) strcpy(__Zephyr_realm, hent->h_name);
- else
- (void) strcpy(__Zephyr_realm, hostname);
+ (void) strcpy(__Zephyr_realm, KRB_REALM);
#endif
/* Get the sender so we can cache it */