summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>2000-04-05 10:57:36 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>2000-04-05 10:57:36 +0000
commit830369ac28a04b936c8dceb3561f49a4c119ff25 (patch)
treeb3fc45f9547251a679dbd5e9a337f84fa3936096
parent80a99d606ab7549a05d853aa2e40922518e99dca (diff)
Add support for -f to disable client flushing.
-rw-r--r--zhm/zhm.87
-rw-r--r--zhm/zhm.c7
-rw-r--r--zhm/zhm_client.c10
3 files changed, 19 insertions, 5 deletions
diff --git a/zhm/zhm.8 b/zhm/zhm.8
index 90feb73..961b7bd 100644
--- a/zhm/zhm.8
+++ b/zhm/zhm.8
@@ -20,6 +20,8 @@ zhm \- Zephyr HostManager
] [
.BI -i
] [
+.BI -f
+] [
.BI server
.BI ...
]
@@ -63,6 +65,11 @@ designated for hostmanager use. In this mode, SIGHUP is handled as if the
.I -h
option were specified.
.PP
+The
+.I -f
+option disables the "flush" operation which allows any client to flush
+all subscriptions for the host.
+.PP
The optional
.I server
arguments are used to replace the set of server names supplied by
diff --git a/zhm/zhm.c b/zhm/zhm.c
index 2c38b1b..38365e6 100644
--- a/zhm/zhm.c
+++ b/zhm/zhm.c
@@ -24,7 +24,7 @@ int use_hesiod = 0;
#define PIDDIR "/var/athena/"
-int hmdebug, rebootflag, errflg, dieflag, inetd, oldpid, nofork;
+int hmdebug, rebootflag, noflushflag, errflg, dieflag, inetd, oldpid, nofork;
int no_server = 1, nservchang, nserv, nclt;
int booting = 1, timeout_type, deactivated = 1;
long starttime;
@@ -76,7 +76,7 @@ char *argv[];
exit(-1);
}
prim_serv[0] = '\0';
- while ((opt = getopt(argc, argv, "drhin")) != EOF)
+ while ((opt = getopt(argc, argv, "drhinf")) != EOF)
switch(opt) {
case 'd':
hmdebug = 1;
@@ -98,6 +98,9 @@ char *argv[];
case 'n':
nofork = 1;
break;
+ case 'f':
+ noflushflag = 1;
+ break;
case '?':
default:
errflg++;
diff --git a/zhm/zhm_client.c b/zhm/zhm_client.c
index 539c43a..6ee448b 100644
--- a/zhm/zhm_client.c
+++ b/zhm/zhm_client.c
@@ -18,7 +18,7 @@ static char rcsid_hm_client_c[] = "$Id$";
#endif /* SABER */
#endif /* lint */
-extern int no_server, nclt, deactivated;
+extern int no_server, nclt, deactivated, noflushflag;
extern struct sockaddr_in cli_sin, serv_sin, from;
void transmission_tower(notice, packet, pak_len)
@@ -33,8 +33,12 @@ void transmission_tower(notice, packet, pak_len)
nclt++;
if (notice->z_kind == HMCTL) {
if (!strcmp(notice->z_opcode, CLIENT_FLUSH)) {
- send_flush_notice(HM_FLUSH);
- deactivated = 1;
+ if (noflushflag)
+ syslog(LOG_INFO, "Client requested hm flush (disabled).");
+ else {
+ send_flush_notice(HM_FLUSH);
+ deactivated = 1;
+ }
} else if (!strcmp(notice->z_opcode, CLIENT_NEW_SERVER)) {
new_server((char *)NULL);
} else {