From f4bb54ce0fb10f1e0529bf84a19ec8088dbf41f9 Mon Sep 17 00:00:00 2001 From: "Robert S. French" Date: Sat, 1 Aug 1987 07:35:45 +0000 Subject: Changed to handle new protocol and packet format --- server/hostm.c | 2 ++ server/main.c | 23 +++++++++-------------- 2 files changed, 11 insertions(+), 14 deletions(-) (limited to 'server') diff --git a/server/hostm.c b/server/hostm.c index e421384..3f373b0 100644 --- a/server/hostm.c +++ b/server/hostm.c @@ -555,6 +555,8 @@ ZServerDesc_t *server; shutnotice.z_opcode = SERVER_SHUTDOWN; shutnotice.z_sender = HM_CTL_SERVER; shutnotice.z_recipient = "hm@ATHENA.MIT.EDU"; + shutnotice.z_default_format = ""; + if (server) { shutnotice.z_message = inet_ntoa(server->zs_addr.sin_addr); shutnotice.z_message_len = strlen(shutnotice.z_message); diff --git a/server/main.c b/server/main.c index 1245e55..4600a92 100644 --- a/server/main.c +++ b/server/main.c @@ -115,7 +115,7 @@ int argc; char **argv; { int nfound; /* #fildes ready on select */ - int authentic; /* authentic flag for ZParseNotice */ + int authentic; /* authentic flag */ Code_t status; ZNotice_t new_notice; /* parsed from input_packet */ ZPacket_t input_packet; /* from the network */ @@ -250,9 +250,7 @@ char **argv; npackets++; if (status = ZParseNotice(input_packet, input_len, - &new_notice, - &authentic, - &whoisit)) { + &new_notice)) { syslog(LOG_ERR, "bad notice parse: %s", error_message(status)); @@ -267,17 +265,14 @@ char **argv; input_sin.sin_addr.s_addr = new_notice.z_sender_addr.s_addr; input_sin.sin_port = new_notice.z_port; input_sin.sin_family = AF_INET; - if (status = ZParseNotice(input_packet, - input_len, - &new_notice, - &authentic, - &input_sin)) { - syslog(LOG_ERR, - "bad srv notice parse: %s", - error_message(status)); - continue; - } + authentic = ZCheckAuthentication(&new_notice, + input_packet, + &input_sin); } + else + authentic = ZCheckAuthentication(&new_notice, + input_packet, + &whoisit); if (whoisit.sin_port != hm_port && strcmp(new_notice.z_class,ZEPHYR_ADMIN_CLASS) && whoisit.sin_port != sock_sin.sin_port && -- cgit v1.2.3