Date: Thu, 22 Feb 2001 19:50:35 +0100 (CET) From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/25288: [PATCH] for arpwatch to specify receiver's email address Message-ID: <200102221850.f1MIoZ726124@curry.mchp.siemens.de>
next in thread | raw e-mail | index | archive | help
>Number: 25288 >Category: ports >Synopsis: [PATCH] for arpwatch to specify receiver's email address >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Feb 22 11:00:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Andre Albsmeier >Release: FreeBSD 4.2-STABLE i386 >Organization: >Environment: FreeBSD systems using the arpwatch port. >Description: When using arpwatch the report emails are sent to root normally. Currently you can't specify another or multiple persons as recipient. >How-To-Repeat: Use arpwatch and look for a possibility to send the reporting emails to other persons. >Fix: The following patch introduces the -m flag. Now you can specify a different recipient which gets the report emails instead of root. For multiple persons who should receive the reports you can create an alias for sendmail. The manpages have been changed as well. --- ./arpwatch.c.ORI Thu Feb 22 17:49:15 2001 +++ ./arpwatch.c Thu Feb 22 17:52:01 2001 @@ -107,6 +107,8 @@ char *prog; +char *Watcher = NULL; + int can_checkpoint; int swapped; int nobogons; @@ -170,7 +172,7 @@ interface = NULL; rfilename = NULL; pd = NULL; - while ((op = getopt(argc, argv, "df:i:n:Nr:")) != EOF) + while ((op = getopt(argc, argv, "df:i:m:n:Nr:")) != EOF) switch (op) { case 'd': @@ -202,6 +204,10 @@ rfilename = optarg; break; + case 'm': + Watcher = optarg; + break; + default: usage(); } @@ -751,6 +757,6 @@ (void)fprintf(stderr, "Version %s\n", version); (void)fprintf(stderr, "usage: %s [-dN] [-f datafile] [-i interface]" - " [-n net[/width]] [-r file]\n", prog); + " [-m email] [-n net[/width]] [-r file]\n", prog); exit(1); } --- ./report.c.ORI Thu Feb 22 17:52:12 2001 +++ ./report.c Thu Feb 22 17:53:34 2001 @@ -70,6 +70,8 @@ #define PLURAL(n) ((n) == 1 || (n) == -1 ? "" : "s") +extern char *Watcher; + static int cdepth; /* number of outstanding children */ static char *fmtdate(time_t); @@ -240,7 +242,7 @@ register FILE *f; char tempfile[64], cpu[64], os[64]; char *fmt = "%20s: %s\n"; - char *watcher = WATCHER; + char *watcher = Watcher ? Watcher : WATCHER; char *watchee = WATCHEE; char *sendmail = PATH_SENDMAIL; char *unknown = "<unknown>"; --- ./arpsnmp.c.ORI Thu Feb 22 17:54:56 2001 +++ ./arpsnmp.c Thu Feb 22 17:56:01 2001 @@ -68,6 +68,8 @@ char *prog; +char *Watcher; + extern int optind; extern int opterr; extern char *optarg; @@ -90,7 +92,7 @@ } opterr = 0; - while ((op = getopt(argc, argv, "df:")) != EOF) + while ((op = getopt(argc, argv, "df:m:")) != EOF) switch (op) { case 'd': @@ -105,6 +107,10 @@ arpfile = optarg; break; + case 'm': + Watcher = optarg; + break; + default: usage(); } @@ -184,6 +190,6 @@ (void)fprintf(stderr, "Version %s\n", version); (void)fprintf(stderr, - "usage: %s [-d] [-f datafile] file [...]\n", prog); + "usage: %s [-d] [-f datafile] [-m email] file [...]\n", prog); exit(1); } --- ./arpwatch.8.ORI Thu Feb 22 18:37:51 2001 +++ ./arpwatch.8 Thu Feb 22 18:49:58 2001 @@ -38,6 +38,9 @@ .br .ti +8 [ +.B -m +.I email +] [ .B -n .IR net [/ width ]] [ @@ -69,6 +72,12 @@ The .B -i flag is used to override the default interface. +.LP +The +.B -m +flag specifies the address that will receive the emails. +The default is +.IR root . .LP The .B -n --- ./arpsnmp.8.ORI Thu Feb 22 18:38:01 2001 +++ ./arpsnmp.8 Thu Feb 22 18:50:33 2001 @@ -30,6 +30,9 @@ ] [ .B -f .I datafile +] [ +.B -m +.I email ] .I file [ @@ -54,6 +57,12 @@ flag is used to set the ethernet/ip address database filename. The default is .IR arp.dat . +.LP +The +.B -m +flag specifies the address that will receive the emails. +The default is +.IR root . .LP Note that an empty .I arp.dat >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102221850.f1MIoZ726124>