From: Theodore Tso Date: Fri, 24 Mar 1995 22:26:07 +0000 (+0000) Subject: If /etc/services doesn't have the kadmin port, use a compiled in default X-Git-Tag: krb5-1.0-beta5~479 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a65338c6961a8c5e5e55b8365086dc6f5d124642;p=krb5.git If /etc/services doesn't have the kadmin port, use a compiled in default git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5231 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/server/ChangeLog b/src/kadmin/server/ChangeLog index b60bd93ad..2d34d2c13 100644 --- a/src/kadmin/server/ChangeLog +++ b/src/kadmin/server/ChangeLog @@ -1,3 +1,8 @@ +Fri Mar 24 14:38:06 1995 + + * adm_network.c (setup_network): If /etc/services doesn't have the + administration port, use a compiled in port. + Thu Mar 2 12:24:50 1995 Theodore Y. Ts'o * Makefile.in (ISODELIB): Remove reference to $(ISODELIB). diff --git a/src/kadmin/server/adm_network.c b/src/kadmin/server/adm_network.c index 58cc9fc5a..d1e296c05 100644 --- a/src/kadmin/server/adm_network.c +++ b/src/kadmin/server/adm_network.c @@ -210,18 +210,25 @@ setup_network(context, prog) service_servent = getservbyname(adm5_tcp_portname, "tcp"); - if (!service_servent) { - krb5_free_principal(context, client_server_info.server); + if (service_servent) { + client_server_info.server_name.sin_port = service_servent->s_port; +#ifdef DEBUG + fprintf(stderr, "Official service name = %s\n", service_servent->s_name); +#endif /* DEBUG */ + } else { +#ifdef ADM5_DEFAULT_PORT + client_server_info.server_name.sin_port = htons(ADM5_DEFAULT_PORT); + com_err("setup_network", 0, "adm_network: using default port %d", + ADM5_DEFAULT_PORT); +#else + krb5_free_principal(client_server_info.server); free(client_server_info.name_of_service); com_err("setup_network", 0, "adm_network: %s/tcp service unknown", adm5_tcp_portname); return(1); +#endif } -#ifdef DEBUG - fprintf(stderr, "Official service name = %s\n", service_servent->s_name); -#endif /* DEBUG */ - client_server_info.server_name.sin_port = service_servent->s_port; if ((client_server_info.server_socket =