aboutsummaryrefslogtreecommitdiffstats
path: root/main/arpwatch/07_all_arpwatch-2.1a15-specify-mail.patch
diff options
context:
space:
mode:
authorFrancesco Colista <francesco.colista@gmail.com>2013-07-08 11:33:58 +0000
committerFrancesco Colista <francesco.colista@gmail.com>2013-07-08 11:34:11 +0000
commit411a2782aaa756b3a8f3988763ac592cff1257b3 (patch)
treef3506a151a9b2e71ed9417f298e40f11e8d66418 /main/arpwatch/07_all_arpwatch-2.1a15-specify-mail.patch
parent0852cf7df3027cc1addd921d31c0b032983196e0 (diff)
downloadaports-411a2782aaa756b3a8f3988763ac592cff1257b3.tar.bz2
aports-411a2782aaa756b3a8f3988763ac592cff1257b3.tar.xz
main/arpwatch: added several patches for improving options and security
Diffstat (limited to 'main/arpwatch/07_all_arpwatch-2.1a15-specify-mail.patch')
-rw-r--r--main/arpwatch/07_all_arpwatch-2.1a15-specify-mail.patch168
1 files changed, 168 insertions, 0 deletions
diff --git a/main/arpwatch/07_all_arpwatch-2.1a15-specify-mail.patch b/main/arpwatch/07_all_arpwatch-2.1a15-specify-mail.patch
new file mode 100644
index 0000000000..b3b34b1246
--- /dev/null
+++ b/main/arpwatch/07_all_arpwatch-2.1a15-specify-mail.patch
@@ -0,0 +1,168 @@
+diff -Naru arpwatch-2.1a15.orig/arpsnmp.8 arpwatch-2.1a15/arpsnmp.8
+--- arpwatch-2.1a15.orig/arpsnmp.8 2006-09-22 19:44:44.000000000 +0400
++++ arpwatch-2.1a15/arpsnmp.8 2006-09-22 19:57:15.000000000 +0400
+@@ -42,6 +42,12 @@
+ ]
+ .br
+ .ti +8
++[
++.B -m
++.I addr
++]
++.br
++.ti +8
+ .I file
+ [
+ .I ...
+@@ -55,6 +61,13 @@
+ .BR snmpwalk (1)).
+ .LP
+ The
++.B -m
++option is used to specify the e-mail address to which reports will be
++sent. By default, reports are sent to
++.I root
++on the local machine. (This feature comes from Debian).
++.LP
++The
+ .B -d
+ flag is used enable debugging. This also inhibits mailing the reports.
+ Instead, they are sent to
+diff -Naru arpwatch-2.1a15.orig/arpsnmp.c arpwatch-2.1a15/arpsnmp.c
+--- arpwatch-2.1a15.orig/arpsnmp.c 2006-09-22 19:46:34.000000000 +0400
++++ arpwatch-2.1a15/arpsnmp.c 2006-09-22 19:57:55.000000000 +0400
+@@ -82,6 +82,7 @@
+ char options[] =
+ "d"
+ "f:"
++ "m:"
+ "s:"
+ ;
+
+@@ -111,6 +112,10 @@
+ arpfile = optarg;
+ break;
+
++ case 'm':
++ mailaddress = optarg;
++ break;
++
+ case 's':
+ path_sendmail = optarg;
+ break;
+@@ -197,6 +202,7 @@
+ char usage[] =
+ "[-d] "
+ "[-f datafile] "
++ "[-m e-mail ] "
+ "[-s sendmail_path] "
+ "file [...]\n"
+ ;
+diff -Naru arpwatch-2.1a15.orig/arpwatch.8 arpwatch-2.1a15/arpwatch.8
+--- arpwatch-2.1a15.orig/arpwatch.8 2006-09-22 19:46:34.000000000 +0400
++++ arpwatch-2.1a15/arpwatch.8 2006-09-22 19:53:35.000000000 +0400
+@@ -46,7 +46,7 @@
+ [
+ .B -n
+ .IR net [/ width
+-]]
++] ]
+ .br
+ .ti +8
+ [
+@@ -56,6 +56,12 @@
+ .br
+ .ti +8
+ [
++.B -m
++.I e-mail
++]
++.br
++.ti +8
++[
+ .B -s
+ .I sendmail_path
+ ]
+@@ -120,6 +126,13 @@
+ does not fork.
+ .LP
+ The
++.B -m
++option is used to specify the e-mail address to which reports will be
++sent. By default, reports are sent to
++.I root
++on the local machine. (This feature comes from Debian).
++.LP
++The
+ .B -s
+ flag is used to specify the path to the sendmail program. Any program that
+ takes the option -odi and then text from stdin can be substituted. This is
+diff -Naru arpwatch-2.1a15.orig/arpwatch.c arpwatch-2.1a15/arpwatch.c
+--- arpwatch-2.1a15.orig/arpwatch.c 2006-09-22 19:46:34.000000000 +0400
++++ arpwatch-2.1a15/arpwatch.c 2006-09-22 19:58:46.000000000 +0400
+@@ -163,6 +163,7 @@
+ "n:"
+ "N"
+ "r:"
++ "m:"
+ "s:"
+ "p"
+ "a"
+@@ -216,6 +217,10 @@
+ rfilename = optarg;
+ break;
+
++ case 'm':
++ mailaddress = optarg;
++ break;
++
+ case 's':
+ path_sendmail = optarg;
+ break;
+@@ -784,6 +789,7 @@
+ "[-i interface] "
+ "[-n net[/width]] "
+ "[-r file] "
++ "[-m e-mail] "
+ "[-s sendmail_path] "
+ "[-p] "
+ "[-a] "
+diff -Naru arpwatch-2.1a15.orig/report.c arpwatch-2.1a15/report.c
+--- arpwatch-2.1a15.orig/report.c 2006-09-22 19:46:34.000000000 +0400
++++ arpwatch-2.1a15/report.c 2006-09-22 19:59:18.000000000 +0400
+@@ -242,7 +242,7 @@
+ register FILE *f;
+ char tempfile[64], cpu[64], os[64];
+ char *fmt = "%20s: %s\n";
+- char *watcher = WATCHER;
++ char *watcher = mailaddress;
+ char *watchee = WATCHEE;
+ char *sendmail = path_sendmail;
+ char *unknown = "<unknown>";
+diff -Naru arpwatch-2.1a15.orig/util.c arpwatch-2.1a15/util.c
+--- arpwatch-2.1a15.orig/util.c 2006-09-22 19:46:34.000000000 +0400
++++ arpwatch-2.1a15/util.c 2006-09-22 20:00:25.000000000 +0400
+@@ -50,6 +50,7 @@
+ #include "ec.h"
+ #include "file.h"
+ #include "util.h"
++#include "addresses.h"
+
+ char *arpdir = ARPDIR;
+ char *arpfile = ARPFILE;
+@@ -63,6 +64,7 @@
+ int initializing = 1; /* true if initializing */
+ int nopromisc = 0; /* don't activate promisc mode by default */
+ int allsubnets = 0; /* watch all attached subnets */
++char *mailaddress = WATCHER;
+
+ /* syslog() helper routine */
+ void
+diff -Naru arpwatch-2.1a15.orig/util.h arpwatch-2.1a15/util.h
+--- arpwatch-2.1a15.orig/util.h 2006-09-22 19:46:34.000000000 +0400
++++ arpwatch-2.1a15/util.h 2006-09-22 20:00:39.000000000 +0400
+@@ -19,3 +19,4 @@
+ extern int initializing;
+ extern int nopromisc;
+ extern int allsubnets;
++extern char *mailaddress;