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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
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;
|