From fullermd@mortis.futuresouth.com  Sun Jan  3 17:59:38 1999
Received: from mortis.futuresouth.com (mortis.futuresouth.com [209.45.228.14])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA08352
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 3 Jan 1999 17:59:37 -0800 (PST)
          (envelope-from fullermd@mortis.futuresouth.com)
Received: (from fullermd@localhost)
	by mortis.futuresouth.com (8.8.8/8.8.5) id TAA23631;
	Sun, 3 Jan 1999 19:59:07 -0600 (CST)
Message-Id: <199901040159.TAA23631@mortis.futuresouth.com>
Date: Sun, 3 Jan 1999 19:59:07 -0600 (CST)
From: fullermd@futuresouth.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Listen option to rwhod(8)
X-Send-Pr-Version: 3.2

>Number:         9301
>Category:       bin
>Synopsis:       Listen option to rwhod(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan  3 18:00:00 PST 1999
>Closed-Date:    Sun Jan 10 21:26:00 PST 1999
>Last-Modified:  Sun Jan 10 21:28:09 PST 1999
>Originator:     Matthew Fuller
>Release:        FreeBSD 2.2.8-STABLE i386
>Organization:
>Environment:

	Made against HEAD (r1.8) but should apply seamlessly to RELENG_2_2
(if someone wants to stick it back there for some reason)

>Description:

	Add a -l option to rwhod for listen-only mode; doesn't broadcast
information, but allows you to monitor the other machines silently.
Man page also updated.

>How-To-Repeat:


>Fix:
	

Index: rwhod.8
===================================================================
RCS file: /usr/cvs/src/usr.sbin/rwhod/rwhod.8,v
retrieving revision 1.8
diff -u -r1.8 rwhod.8
--- rwhod.8	1998/12/17 11:05:57	1.8
+++ rwhod.8	1999/01/04 01:21:59
@@ -40,6 +40,7 @@
 .Sh SYNOPSIS
 .Nm rwhod
 .Op Fl i
+.Op Fl l
 .Op Fl m Op Ar ttl
 .Sh DESCRIPTION
 .Nm Rwhod
@@ -54,7 +55,9 @@
 messages on a network.
 .Pp
 .Nm Rwhod
-operates as both a producer and consumer of status information.
+operates as both a producer and consumer of status information,
+unless the -l (listen mode) option is specified, in which case
+it acts as a consumer only.
 As a producer of information it periodically
 queries the state of the system and constructs
 status messages which are broadcasted or multicasted on a network.
@@ -69,6 +72,15 @@
 option enables insecure mode, which causes
 .Nm
 to ignore the source port on incoming packets.
+.Pp
+The
+.Fl l
+option enables listen mode, which causes
+.Nm
+to not broadcast any information.
+This allows you to monitor other machines'
+.Nm
+information, without broadcasting your own.
 .Pp
 The
 .Fl m
Index: rwhod.c
===================================================================
RCS file: /usr/cvs/src/usr.sbin/rwhod/rwhod.c,v
retrieving revision 1.8
diff -u -r1.8 rwhod.c
--- rwhod.c	1998/12/17 11:05:57	1.8
+++ rwhod.c	1999/01/04 01:08:05
@@ -116,6 +116,7 @@
 					  /* (belongs in protocols/rwhod.h) */
 
 int			insecure_mode;
+int			quiet_mode;
 int			multicast_mode  = NO_MULTICAST;
 int			multicast_scope;
 struct sockaddr_in	multicast_addr  = { sizeof multicast_addr, AF_INET };
@@ -197,6 +198,8 @@
 		}
 		else if (strcmp(*argv, "-i") == 0)
 		    insecure_mode = 1;
+		else if (strcmp(*argv, "-l") == 0)
+			quiet_mode = 1;
 		else
 			usage();
 		argv++, argc--;
@@ -255,8 +258,10 @@
 	setuid(unpriv_uid);
 	if (!configure(s))
 		exit(1);
-	signal(SIGALRM, onalrm);
-	onalrm(0);
+	if(!quiet_mode) {
+		signal(SIGALRM, onalrm);
+		onalrm(0);
+	}
 	for (;;) {
 		struct whod wd;
 		int cc, whod, len = sizeof(from);

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sun Jan 10 21:26:00 PST 1999 
State-Changed-Why:  
Committed, thanks! 
>Unformatted:
