diff options
author | des <des@FreeBSD.org> | 1998-12-17 11:05:57 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 1998-12-17 11:05:57 +0000 |
commit | d3d2905cbc36da5333c44ede4c098b27fa77f59f (patch) | |
tree | 26181a596466b33b7bb2de0c77319d2b0d2bc814 /usr.sbin/rwhod | |
parent | 947e64babb6719e552127815a51a1188ce407684 (diff) | |
download | FreeBSD-src-d3d2905cbc36da5333c44ede4c098b27fa77f59f.zip FreeBSD-src-d3d2905cbc36da5333c44ede4c098b27fa77f59f.tar.gz |
Add an option for insecure mode, in which rwhod does not discard packets
from incorrect source ports.
Diffstat (limited to 'usr.sbin/rwhod')
-rw-r--r-- | usr.sbin/rwhod/rwhod.8 | 11 | ||||
-rw-r--r-- | usr.sbin/rwhod/rwhod.c | 9 |
2 files changed, 16 insertions, 4 deletions
diff --git a/usr.sbin/rwhod/rwhod.8 b/usr.sbin/rwhod/rwhod.8 index a7243e4..f1aa636 100644 --- a/usr.sbin/rwhod/rwhod.8 +++ b/usr.sbin/rwhod/rwhod.8 @@ -39,6 +39,7 @@ .Nd system status server .Sh SYNOPSIS .Nm rwhod +.Op Fl i .Op Fl m Op Ar ttl .Sh DESCRIPTION .Nm Rwhod @@ -64,6 +65,12 @@ them in a collection of files located in the directory .Pa /var/rwho . .Pp The +.Fl i +option enables insecure mode, which causes +.Nm +to ignore the source port on incoming packets. +.Pp +The .Fl m option causes .Nm @@ -163,7 +170,9 @@ Messages received by the .Nm rwho server are discarded unless they originated at an .Nm rwho -server's port. In addition, if the host's name, as specified +server's port or the +.Fl i +option was specified. In addition, if the host's name, as specified in the message, contains any unprintable .Tn ASCII characters, the diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index 229d1f17..dcd6def 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)rwhod.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: rwhod.c,v 1.7 1997/10/13 11:27:55 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -115,6 +115,7 @@ static const char rcsid[] = #define INADDR_WHOD_GROUP (u_long)0xe0000103 /* 224.0.1.3 */ /* (belongs in protocols/rwhod.h) */ +int insecure_mode; int multicast_mode = NO_MULTICAST; int multicast_scope; struct sockaddr_in multicast_addr = { sizeof multicast_addr, AF_INET }; @@ -194,6 +195,8 @@ main(argc, argv) } else multicast_mode = PER_INTERFACE_MULTICAST; } + else if (strcmp(*argv, "-i") == 0) + insecure_mode = 1; else usage(); argv++, argc--; @@ -265,7 +268,7 @@ main(argc, argv) syslog(LOG_WARNING, "recv: %m"); continue; } - if (from.sin_port != sp->s_port) { + if (from.sin_port != sp->s_port && !insecure_mode) { syslog(LOG_WARNING, "%d: bad from port", ntohs(from.sin_port)); continue; @@ -319,7 +322,7 @@ main(argc, argv) static void usage() { - fprintf(stderr, "usage: rwhod [-m [ttl]]\n"); + fprintf(stderr, "usage: rwhod [-i] [-m [ttl]]\n"); exit(1); } |