Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
aports
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
647
Issues
647
List
Boards
Labels
Service Desk
Milestones
Merge Requests
179
Merge Requests
179
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
aports
Commits
411a2782
Commit
411a2782
authored
Jul 08, 2013
by
Francesco Colista
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main/arpwatch: added several patches for improving options and security
parent
0852cf7d
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
2637 additions
and
6 deletions
+2637
-6
main/arpwatch/01_all_arpwatch-2.1a15-manpages.patch
main/arpwatch/01_all_arpwatch-2.1a15-manpages.patch
+69
-0
main/arpwatch/02_all_arpwatch-2.1a15-srcdir.patch
main/arpwatch/02_all_arpwatch-2.1a15-srcdir.patch
+250
-0
main/arpwatch/03_all_arpwatch-2.1a15-getopt.patch
main/arpwatch/03_all_arpwatch-2.1a15-getopt.patch
+150
-0
main/arpwatch/04_all_arpwatch-2.1a15-sendmail-cmdline-opt.patch
...rpwatch/04_all_arpwatch-2.1a15-sendmail-cmdline-opt.patch
+159
-0
main/arpwatch/05_all_arpwatch-2.1a15-promiscuous-mode.patch
main/arpwatch/05_all_arpwatch-2.1a15-promiscuous-mode.patch
+89
-0
main/arpwatch/06_all_arpwatch-2.1a15-bogons-report.patch
main/arpwatch/06_all_arpwatch-2.1a15-bogons-report.patch
+507
-0
main/arpwatch/07_all_arpwatch-2.1a15-specify-mail.patch
main/arpwatch/07_all_arpwatch-2.1a15-specify-mail.patch
+168
-0
main/arpwatch/08_all_arpwatch-2.1a15-drop-priveleges.patch
main/arpwatch/08_all_arpwatch-2.1a15-drop-priveleges.patch
+147
-0
main/arpwatch/09_all_arpwatch-2.1a15-quite-mail.patch
main/arpwatch/09_all_arpwatch-2.1a15-quite-mail.patch
+90
-0
main/arpwatch/10_all_arpwatch-2.1a15-ignore-net.patch
main/arpwatch/10_all_arpwatch-2.1a15-ignore-net.patch
+97
-0
main/arpwatch/11_all_arpwatch-2.1a15-secure-tmp.patch
main/arpwatch/11_all_arpwatch-2.1a15-secure-tmp.patch
+26
-0
main/arpwatch/12_all_arpwatch-2.1a15-defalt-dir-in-manpages.patch
...watch/12_all_arpwatch-2.1a15-defalt-dir-in-manpages.patch
+24
-0
main/arpwatch/13_all_arpwatch-2.1a15-scripts-awk.patch
main/arpwatch/13_all_arpwatch-2.1a15-scripts-awk.patch
+31
-0
main/arpwatch/14_all_arpwatch-2.1a15-paths-fix.patch
main/arpwatch/14_all_arpwatch-2.1a15-paths-fix.patch
+35
-0
main/arpwatch/15_all_arpwatch-2.1a15-fix-dead-lock.patch
main/arpwatch/15_all_arpwatch-2.1a15-fix-dead-lock.patch
+32
-0
main/arpwatch/16_all_arpwatch-2.1a15-additional-manpages-cleanups.patch
...16_all_arpwatch-2.1a15-additional-manpages-cleanups.patch
+98
-0
main/arpwatch/17_all_arpwatch-2.1a15-restart.patch
main/arpwatch/17_all_arpwatch-2.1a15-restart.patch
+162
-0
main/arpwatch/18_all_arpwatch-2.1a15-nofork.patch
main/arpwatch/18_all_arpwatch-2.1a15-nofork.patch
+94
-0
main/arpwatch/19_all_arpwatch-2.1a15-nonewstation.patch
main/arpwatch/19_all_arpwatch-2.1a15-nonewstation.patch
+100
-0
main/arpwatch/20_all_arpwatch-2.1a15-noreversedns-resolve.patch
...rpwatch/20_all_arpwatch-2.1a15-noreversedns-resolve.patch
+99
-0
main/arpwatch/21_all_arpwatch-2.1a15-pid-filename.patch
main/arpwatch/21_all_arpwatch-2.1a15-pid-filename.patch
+108
-0
main/arpwatch/APKBUILD
main/arpwatch/APKBUILD
+98
-6
main/arpwatch/arpwatch.pre-install
main/arpwatch/arpwatch.pre-install
+4
-0
No files found.
main/arpwatch/01_all_arpwatch-2.1a15-manpages.patch
0 → 100644
View file @
411a2782
Taken from tcpdump-3.8.2-14.FC4.src.rpm with some similar fixes for arpwatch.8
and and fixes unescaped hyphen in arpwatch and arpsnmp man pages.
diff -Naru arpwatch-2.1a15.orig/arpsnmp.8 arpwatch-2.1a15/arpsnmp.8
--- arpwatch-2.1a15.orig/arpsnmp.8 2000-09-18 00:34:48.000000000 +0400
+++ arpwatch-2.1a15/arpsnmp.8 2006-09-22 19:21:55.000000000 +0400
@@ -22,7 +22,7 @@
.TH ARPSNMP 8 "17 September 2000"
.UC 4
.SH NAME
-arpsnmp - keep track of ethernet/ip address pairings
+arpsnmp \- keep track of ethernet/ip address pairings
.SH SYNOPSIS
.B arpsnmp
[
@@ -41,7 +41,7 @@
and reports certain changes via email.
.B Arpsnmp
reads information from a file (usually generated by
-.BR snmpwalk (8)).
+.BR snmpwalk (1)).
.LP
The
.B -d
@@ -62,9 +62,9 @@
.LP
.SH "REPORT MESSAGES"
(See the
-.BR arpwatch (1)
+.BR arpwatch (8)
man page for details on the report messages generated by
-.BR arpsnmp (1).)
+.BR arpsnmp (8).)
.SH FILES
.na
.nh
@@ -79,7 +79,7 @@
.na
.nh
.BR arpwatch (8),
-.BR snmpwalk (8),
+.BR snmpwalk (1),
.BR arp (8)
.ad
.hy
diff -Naru arpwatch-2.1a15.orig/arpwatch.8 arpwatch-2.1a15/arpwatch.8
--- arpwatch-2.1a15.orig/arpwatch.8 2000-10-09 00:31:28.000000000 +0400
+++ arpwatch-2.1a15/arpwatch.8 2006-09-22 19:22:07.000000000 +0400
@@ -22,7 +22,7 @@
.TH ARPWATCH 8 "8 October 2000"
.UC 4
.SH NAME
-arpwatch - keep track of ethernet/ip address pairings
+arpwatch \- keep track of ethernet/ip address pairings
.SH SYNOPSIS
.na
.B arpwatch
@@ -101,9 +101,9 @@
.LP
.SH "REPORT MESSAGES"
Here's a quick list of the report messages generated by
-.BR arpwatch (1)
+.BR arpwatch (8)
(and
-.BR arpsnmp (1)):
+.BR arpsnmp (8)):
.TP
.B "new activity"
This ethernet/ip address pair has been used for the first time six
main/arpwatch/02_all_arpwatch-2.1a15-srcdir.patch
0 → 100644
View file @
411a2782
Patch for aclocal, Makefile.in, configure.in to handle srcdir correctly.
diff -Naru arpwatch-2.1a15.orig/aclocal.m4 arpwatch-2.1a15/aclocal.m4
--- arpwatch-2.1a15.orig/aclocal.m4 2006-03-28 11:55:40.000000000 +0400
+++ arpwatch-2.1a15/aclocal.m4 2006-09-22 16:16:24.000000000 +0400
@@ -50,7 +50,7 @@
$1="-O"
$2=""
if test "${srcdir}" != "." ; then
- $2="-I\$\(srcdir\)"
+ $2="-I\$(srcdir)"
fi
if test "${CFLAGS+set}" = set; then
LBL_CFLAGS="$CFLAGS"
diff -Naru arpwatch-2.1a15.orig/configure.in arpwatch-2.1a15/configure.in
--- arpwatch-2.1a15.orig/configure.in 2006-06-22 00:34:29.000000000 +0400
+++ arpwatch-2.1a15/configure.in 2006-09-22 16:16:24.000000000 +0400
@@ -143,17 +143,17 @@
AC_DEFINE(HAVE_DN_SKIPNAME)
fi
-if test -f .devel ; then
+if test -f $srcdir/.devel ; then
AC_DEFINE(LBL)
fi
-if test -r lbl/gnuc.h ; then
- rm -f gnuc.h
- ln -s lbl/gnuc.h gnuc.h
+if test -r $srcdir/lbl/gnuc.h ; then
+ rm -f $srcdir/gnuc.h
+ ln -s lbl/gnuc.h $srcdir/gnuc.h
fi
-if test ! -r addresses.h ; then
- cp addresses.h.in addresses.h
+if test ! -r $srcdir/addresses.h ; then
+ cp $srcdir/addresses.h.in $srcdir/addresses.h
fi
AC_SUBST(V_CCOPT)
@@ -166,12 +166,12 @@
AC_OUTPUT(Makefile)
-if test ! -f arp.dat ; then
+if test ! -f $srcdir/arp.dat ; then
echo 'creating empty arp.dat file'
- touch arp.dat
+ touch $srcdir/arp.dat
fi
-if test -f .devel ; then
+if test -f $srcdir/.devel ; then
make depend
fi
exit 0
diff -Naru arpwatch-2.1a15.orig/configure.in.orig arpwatch-2.1a15/configure.in.orig
--- arpwatch-2.1a15.orig/configure.in.orig 1970-01-01 03:00:00.000000000 +0300
+++ arpwatch-2.1a15/configure.in.orig 2006-06-22 00:34:29.000000000 +0400
@@ -0,0 +1,177 @@
+dnl @(#) $Header: /usr/src/local/sbin/arpwatch/RCS/configure.in,v 1.35 2006/06/21 20:34:27 leres Exp $ (LBL)
+dnl
+dnl Copyright (c) 1994, 1995, 1996, 1997, 1998, 2000, 2006
+dnl The Regents of the University of California. All rights reserved.
+dnl
+dnl Process this file with autoconf to produce a configure script.
+dnl
+
+AC_INIT(arpwatch.c)
+
+AC_CANONICAL_SYSTEM
+
+umask 002
+
+if test -z "$PWD" ; then
+ PWD=`pwd`
+fi
+
+AC_LBL_C_INIT(V_CCOPT, V_INCLS)
+
+AC_CHECK_HEADERS(fcntl.h memory.h)
+AC_HEADER_TIME
+
+AC_REPLACE_FUNCS(bcopy strerror)
+
+dnl The following generates a warning from autoconf...
+AC_C_BIGENDIAN
+
+AC_LBL_TYPE_SIGNAL
+AC_LBL_UNION_WAIT
+
+AC_CHECK_LIB(resolv, res_query)
+AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
+
+AC_PATH_PROG(V_SENDMAIL, sendmail, /usr/lib/sendmail,
+ $PATH:/usr/sbin:/usr/lib:/usr/bin:/usr/ucblib:/usr/local/etc)
+
+case "$target_os" in
+
+linux*)
+ V_INCLS="$V_INCLS -Ilinux-include"
+ ;;
+
+osf3*)
+ # workaround around ip_hl vs. ip_vhl problem in netinet/ip.h
+ AC_DEFINE(__STDC__,2)
+ ;;
+esac
+
+AC_LBL_CHECK_TYPE
+
+AC_LBL_DEVEL(V_CCOPT)
+
+AC_MSG_CHECKING(if ether_header uses ether_addr structs)
+AC_CACHE_VAL(ac_cv_ether_header_has_ea,
+ LBL_SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $V_INCLS"
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# if __STDC__
+ /* osf3 has REALLY good prototyes */
+ struct mbuf;
+ struct rtentry;
+# endif
+# include <sys/socket.h>
+# include <net/if.h>
+# include <netinet/in.h>
+# include <netinet/if_ether.h>],
+ [u_int i =
+ sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)],
+ ac_cv_ether_header_has_ea=yes,
+ ac_cv_ether_header_has_ea=no)
+ CFLAGS="$LBL_SAVE_CFLAGS")
+AC_MSG_RESULT($ac_cv_ether_header_has_ea)
+if test $ac_cv_ether_header_has_ea = yes ; then
+ AC_DEFINE(ETHER_HEADER_HAS_EA)
+fi
+
+AC_MSG_CHECKING(if ether_arp uses ether_addr structs)
+AC_CACHE_VAL(ac_cv_ether_arp_has_ea,
+ LBL_SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $V_INCLS"
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# if __STDC__
+ /* osf3 has REALLY good prototyes */
+ struct mbuf;
+ struct rtentry;
+# endif
+# include <sys/socket.h>
+# include <net/if.h>
+# include <netinet/in.h>
+# include <netinet/if_ether.h>],
+ [u_int i =
+ sizeof(((struct ether_arp *)0)->arp_sha.ether_addr_octet)],
+ ac_cv_ether_arp_has_ea=yes,
+ ac_cv_ether_arp_has_ea=no)
+ CFLAGS="$LBL_SAVE_CFLAGS")
+AC_MSG_RESULT($ac_cv_ether_arp_has_ea)
+if test $ac_cv_ether_arp_has_ea = yes ; then
+ AC_DEFINE(ETHER_ARP_HAS_EA)
+fi
+
+AC_MSG_CHECKING(if ether_arp uses erp_xsha member)
+AC_CACHE_VAL(ac_cv_struct_ether_arp_x,
+ LBL_SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $V_INCLS"
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# include <sys/socket.h>
+# if __STDC__
+ /* osf3 has REALLY good prototyes */
+ struct mbuf;
+ struct rtentry;
+# endif
+# include <net/if.h>
+# include <netinet/in.h>
+# include <netinet/if_ether.h>],
+ [u_int i = sizeof( ((struct ether_arp *)0)->arp_xsha)],
+ ac_cv_struct_ether_arp_x=yes,
+ ac_cv_struct_ether_arp_x=no)
+ CFLAGS="$LBL_SAVE_CFLAGS")
+AC_MSG_RESULT($ac_cv_struct_ether_arp_x)
+if test $ac_cv_struct_ether_arp_x = yes ; then
+ AC_DEFINE(ETHER_ARP_HAS_X)
+fi
+
+dnl
+dnl bind 8 does some routine name renaming so we must test specially
+dnl
+AC_MSG_CHECKING(for dn_skipname)
+AC_CACHE_VAL(ac_cv_have_dn_skipname,
+ AC_TRY_LINK([
+# include <sys/types.h>
+# include <netinet/in.h>
+# include <arpa/nameser.h>
+# include <resolv.h>],
+ [(void)dn_skipname(0, 0);],
+ ac_cv_have_dn_skipname=yes,
+ ac_cv_have_dn_skipname=no))
+AC_MSG_RESULT($ac_cv_have_dn_skipname)
+if test $ac_cv_have_dn_skipname = yes ; then
+ AC_DEFINE(HAVE_DN_SKIPNAME)
+fi
+
+if test -f .devel ; then
+ AC_DEFINE(LBL)
+fi
+
+if test -r lbl/gnuc.h ; then
+ rm -f gnuc.h
+ ln -s lbl/gnuc.h gnuc.h
+fi
+
+if test ! -r addresses.h ; then
+ cp addresses.h.in addresses.h
+fi
+
+AC_SUBST(V_CCOPT)
+AC_SUBST(V_INCLS)
+AC_SUBST(V_PCAPDEP)
+AC_SUBST(V_SENDMAIL)
+AC_SUBST(LBL_LIBS)
+
+AC_PROG_INSTALL
+
+AC_OUTPUT(Makefile)
+
+if test ! -f arp.dat ; then
+ echo 'creating empty arp.dat file'
+ touch arp.dat
+fi
+
+if test -f .devel ; then
+ make depend
+fi
+exit 0
diff -Naru arpwatch-2.1a15.orig/Makefile.in arpwatch-2.1a15/Makefile.in
--- arpwatch-2.1a15.orig/Makefile.in 2000-06-15 04:39:55.000000000 +0400
+++ arpwatch-2.1a15/Makefile.in 2006-09-22 16:16:24.000000000 +0400
@@ -104,7 +104,7 @@
version.o: version.c
version.c: $(srcdir)/VERSION
@rm -f $@
- sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@
+ sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $(srcdir)/$@
zap: zap.o intoa.o
$(CC) $(CFLAGS) -o $@ zap.o intoa.o -lutil
main/arpwatch/03_all_arpwatch-2.1a15-getopt.patch
0 → 100644
View file @
411a2782
Patch from debian. Just reorders usage output and getopt options to ease adding new features.
diff -Naru arpwatch-2.1a15.orig/arpsnmp.8 arpwatch-2.1a15/arpsnmp.8
--- arpwatch-2.1a15.orig/arpsnmp.8 2006-09-22 17:18:02.000000000 +0400
+++ arpwatch-2.1a15/arpsnmp.8 2006-09-22 18:17:44.000000000 +0400
@@ -27,10 +27,15 @@
.B arpsnmp
[
.B -d
-] [
+]
+.br
+.ti +8
+[
.B -f
.I datafile
]
+.br
+.ti +8
.I file
[
.I ...
diff -Naru arpwatch-2.1a15.orig/arpsnmp.c arpwatch-2.1a15/arpsnmp.c
--- arpwatch-2.1a15.orig/arpsnmp.c 2004-01-23 01:25:17.000000000 +0300
+++ arpwatch-2.1a15/arpsnmp.c 2006-09-22 18:17:15.000000000 +0400
@@ -78,6 +78,10 @@
register char *cp;
register int op, i;
char errbuf[256];
+ char options[] =
+ "d"
+ "f:"
+ ;
if ((cp = strrchr(argv[0], '/')) != NULL)
prog = cp + 1;
@@ -90,7 +94,7 @@
}
opterr = 0;
- while ((op = getopt(argc, argv, "df:")) != EOF)
+ while ((op = getopt(argc, argv, options)) != EOF)
switch (op) {
case 'd':
@@ -182,9 +186,14 @@
usage(void)
{
extern char version[];
+ char usage[] =
+ "[-d] "
+ "[-f datafile] "
+ "file [...]\n"
+ ;
(void)fprintf(stderr, "Version %s\n", version);
(void)fprintf(stderr,
- "usage: %s [-d] [-f datafile] file [...]\n", prog);
+ "usage: %s %s", prog, usage);
exit(1);
}
diff -Naru arpwatch-2.1a15.orig/arpwatch.8 arpwatch-2.1a15/arpwatch.8
--- arpwatch-2.1a15.orig/arpwatch.8 2006-09-22 17:18:02.000000000 +0400
+++ arpwatch-2.1a15/arpwatch.8 2006-09-22 18:19:20.000000000 +0400
@@ -28,10 +28,16 @@
.B arpwatch
[
.B -dN
-] [
+]
+.br
+.ti +8
+[
.B -f
.I datafile
-] [
+]
+.br
+.ti +8
+[
.B -i
.I interface
]
@@ -40,7 +46,10 @@
[
.B -n
.IR net [/ width
-]] [
+]]
+.br
+.ti +8
+[
.B -r
.I file
]
diff -Naru arpwatch-2.1a15.orig/arpwatch.c arpwatch-2.1a15/arpwatch.c
--- arpwatch-2.1a15.orig/arpwatch.c 2004-01-23 01:18:20.000000000 +0300
+++ arpwatch-2.1a15/arpwatch.c 2006-09-22 18:22:35.000000000 +0400
@@ -153,6 +153,14 @@
register char *interface, *rfilename;
struct bpf_program code;
char errbuf[PCAP_ERRBUF_SIZE];
+ char options[] =
+ "d"
+ "f:"
+ "i:"
+ "n:"
+ "N"
+ "r:"
+ ;
if (argv[0] == NULL)
prog = "arpwatch";
@@ -170,7 +178,7 @@
interface = NULL;
rfilename = NULL;
pd = NULL;
- while ((op = getopt(argc, argv, "df:i:n:Nr:")) != EOF)
+ while ((op = getopt(argc, argv, options)) != EOF)
switch (op) {
case 'd':
@@ -201,7 +209,6 @@
case 'r':
rfilename = optarg;
break;
-
default:
usage();
}
@@ -748,9 +755,16 @@
usage(void)
{
extern char version[];
+ char usage[] =
+ "[-dN] "
+ "[-f datafile] "
+ "[-i interface] "
+ "[-n net[/width]] "
+ "[-r file] "
+ "\n"
+ ;
(void)fprintf(stderr, "Version %s\n", version);
- (void)fprintf(stderr, "usage: %s [-dN] [-f datafile] [-i interface]"
- " [-n net[/width]] [-r file]\n", prog);
+ (void)fprintf(stderr, "usage: %s %s", prog, usage);
exit(1);
}
main/arpwatch/04_all_arpwatch-2.1a15-sendmail-cmdline-opt.patch
0 → 100644
View file @
411a2782
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;
main/arpwatch/05_all_arpwatch-2.1a15-promiscuous-mode.patch
0 → 100644
View file @
411a2782
diff -Naru arpwatch-2.1a15.orig/arpwatch.8 arpwatch-2.1a15/arpwatch.8
--- arpwatch-2.1a15.orig/arpwatch.8 2006-09-22 19:33:49.000000000 +0400
+++ arpwatch-2.1a15/arpwatch.8 2006-09-22 19:34:52.000000000 +0400
@@ -59,6 +59,11 @@
.B -s
.I sendmail_path
]
+.br
+.ti +8
+[
+.B -p
+]
.ad
.SH DESCRIPTION
.B Arpwatch
@@ -116,6 +121,15 @@