summaryrefslogtreecommitdiffstats
path: root/main/arpwatch/09_all_arpwatch-2.1a15-quite-mail.patch
blob: ce5c4b244b2d12453eea2c591e9b998c63433c77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
diff -Naru arpwatch-2.1a15.orig/arpwatch.8 arpwatch-2.1a15/arpwatch.8
--- arpwatch-2.1a15.orig/arpwatch.8	2006-09-23 22:16:05.000000000 +0400
+++ arpwatch-2.1a15/arpwatch.8	2006-09-23 22:17:15.000000000 +0400
@@ -87,6 +87,11 @@
 .B -R
 .I seconds
 ]
+.br
+.ti +8
+[
+.B -Q
+]
 .ad
 .SH DESCRIPTION
 .B Arpwatch
@@ -197,6 +202,10 @@
 .B -u
 flags are used. (This feature comes from Debian).
 .LP
+The
+.B -Q
+flags prevents arpwatch from sending reports by mail. (This feature comes from Debian).
+.LP
 Note that an empty
 .I arp.dat
 file must be created before the first time you run
diff -Naru arpwatch-2.1a15.orig/arpwatch.c arpwatch-2.1a15/arpwatch.c
--- arpwatch-2.1a15.orig/arpwatch.c	2006-09-23 22:16:05.000000000 +0400
+++ arpwatch-2.1a15/arpwatch.c	2006-09-23 22:18:10.000000000 +0400
@@ -188,6 +188,7 @@
 		"p"
 		"a"
 		"u:"
+		"Q"
 	;
 
 	if (argv[0] == NULL)
@@ -258,6 +259,11 @@
 			username = optarg;
 			break;
 
+		case 'Q':
+			++quiet;
+			break;
+
+
 		default:
 			usage();
 		}
@@ -823,6 +829,7 @@
 		"[-p] "
 		"[-a] "
 		"[-u username] "
+		"[-Q ] "
 		"\n"
 	;
 
diff -Naru arpwatch-2.1a15.orig/report.c arpwatch-2.1a15/report.c
--- arpwatch-2.1a15.orig/report.c	2006-09-23 22:13:55.000000000 +0400
+++ arpwatch-2.1a15/report.c	2006-09-23 22:17:15.000000000 +0400
@@ -274,6 +274,10 @@
 		/* Syslog this event too */
 		dosyslog(LOG_NOTICE, title, a, e1, e2, interface);
 
+		/* return if watcher is an empty string */
+		if ( quiet )
+			return;
+
 		/* Update child depth */
 		++cdepth;
 
diff -Naru arpwatch-2.1a15.orig/util.c arpwatch-2.1a15/util.c
--- arpwatch-2.1a15.orig/util.c	2006-09-23 22:13:55.000000000 +0400
+++ arpwatch-2.1a15/util.c	2006-09-23 22:17:15.000000000 +0400
@@ -65,6 +65,7 @@
 int nopromisc = 0;			/* don't activate promisc mode by default */
 int allsubnets = 0;			/* watch all attached subnets */
 char *mailaddress = WATCHER;
+int quiet = 0;				/* send mail by default */
 
 /* 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-23 22:13:55.000000000 +0400
+++ arpwatch-2.1a15/util.h	2006-09-23 22:17:15.000000000 +0400
@@ -20,3 +20,4 @@
 extern int nopromisc;
 extern int allsubnets;
 extern char *mailaddress;
+extern int quiet;