summaryrefslogtreecommitdiffstats
path: root/main/arpwatch/04_all_arpwatch-2.1a15-sendmail-cmdline-opt.patch
blob: 3b2ec7f4cd0dd5773e04b6cc7e91f857c0292e84 (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
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
This patch from debian adds possibility to specify sendmail program.

diff -Naru arpwatch-2.1a15.orig/arpsnmp.8 arpwatch-2.1a15/arpsnmp.8
--- arpwatch-2.1a15.orig/arpsnmp.8	2006-09-22 19:26:53.000000000 +0400
+++ arpwatch-2.1a15/arpsnmp.8	2006-09-22 19:31:59.000000000 +0400
@@ -36,6 +36,12 @@
 ]
 .br
 .ti +8
+[
+.B -s
+.I sendmail_path
+]
+.br
+.ti +8
 .I file
 [
 .I ...
@@ -60,6 +66,13 @@
 The default is
 .IR arp.dat .
 .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
+useful for redirecting reports to log files instead of 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/arpsnmp.c arpwatch-2.1a15/arpsnmp.c
--- arpwatch-2.1a15.orig/arpsnmp.c	2006-09-22 19:26:53.000000000 +0400
+++ arpwatch-2.1a15/arpsnmp.c	2006-09-22 19:26:23.000000000 +0400
@@ -67,6 +67,7 @@
 __dead	void usage(void) __attribute__((volatile));
 
 char *prog;
+char *path_sendmail = PATH_SENDMAIL;
 
 extern int optind;
 extern int opterr;
@@ -81,6 +82,7 @@
 	char options[] =
 		"d"
 		"f:"
+		"s:"
 	;
 
 	if ((cp = strrchr(argv[0], '/')) != NULL)
@@ -109,6 +111,10 @@
 			arpfile = optarg;
 			break;
 
+		case 's':
+			path_sendmail = optarg;
+			break;
+
 		default:
 			usage();
 		}
@@ -189,6 +195,7 @@
 	char usage[] =
 		"[-d] "
 		"[-f datafile] "
+		"[-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:26:53.000000000 +0400
+++ arpwatch-2.1a15/arpwatch.8	2006-09-22 19:28:02.000000000 +0400
@@ -53,6 +53,12 @@
 .B -r
 .I file
 ]
+.br
+.ti +8
+[
+.B -s
+.I sendmail_path
+]
 .ad
 .SH DESCRIPTION
 .B Arpwatch
@@ -103,6 +109,13 @@
 .B arpwatch
 does not fork.
 .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
+useful for redirecting reports to log files instead of 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-22 19:26:53.000000000 +0400
+++ arpwatch-2.1a15/arpwatch.c	2006-09-22 19:26:23.000000000 +0400
@@ -106,6 +106,7 @@
 #endif
 
 char *prog;
+char *path_sendmail = PATH_SENDMAIL;
 
 int can_checkpoint;
 int swapped;
@@ -160,6 +161,7 @@
 		"n:"
 		"N"
 		"r:"
+		"s:"
 	;
 
 	if (argv[0] == NULL)
@@ -209,6 +211,11 @@
 		case 'r':
 			rfilename = optarg;
 			break;
+
+		case 's':
+			path_sendmail = optarg;
+			break;
+
 		default:
 			usage();
 		}
@@ -761,6 +768,7 @@
 		"[-i interface] "
 		"[-n net[/width]] "
 		"[-r file] "
+		"[-s sendmail_path] "
 		"\n"
 	;
 
diff -Naru arpwatch-2.1a15.orig/report.c arpwatch-2.1a15/report.c
--- arpwatch-2.1a15.orig/report.c	2000-10-01 03:41:10.000000000 +0400
+++ arpwatch-2.1a15/report.c	2006-09-22 19:26:23.000000000 +0400
@@ -235,6 +235,7 @@
 report(register char *title, register u_int32_t a, register u_char *e1,
     register u_char *e2, register time_t *t1p, register time_t *t2p)
 {
+	extern char *path_sendmail;
 	register char *cp, *hn;
 	register int fd, pid;
 	register FILE *f;
@@ -242,7 +243,7 @@
 	char *fmt = "%20s: %s\n";
 	char *watcher = WATCHER;
 	char *watchee = WATCHEE;
-	char *sendmail = PATH_SENDMAIL;
+	char *sendmail = path_sendmail;
 	char *unknown = "<unknown>";
 	char buf[132];
 	static int init = 0;