diff --git a/SOURCES/arpwatch-promisc.patch b/SOURCES/arpwatch-promisc.patch new file mode 100644 index 0000000..67daf07 --- /dev/null +++ b/SOURCES/arpwatch-promisc.patch @@ -0,0 +1,105 @@ +--- a/arpwatch.8 2016-03-02 13:06:36.712324185 +0100 ++++ b/arpwatch.8 2016-03-02 13:07:03.091306605 +0100 +@@ -27,7 +27,7 @@ arpwatch - keep track of ethernet/ip add + .na + .B arpwatch + [ +-.B -dN ++.B -dNp + ] [ + .B -f + .I datafile +@@ -70,6 +70,10 @@ background and emailing the reports. Ins + .IR stderr . + .LP + The ++.B -p ++flag disables promiscuous mode. ++.LP ++The + .B -f + flag is used to set the ethernet/ip address database filename. + The default is +--- a/arpwatch.c 2016-03-02 13:06:36.723324178 +0100 ++++ b/arpwatch.c 2016-03-02 13:11:20.650134958 +0100 +@@ -162,7 +162,7 @@ void dropprivileges(const char* user) + } + + char * +-try_dev(char *interface, pcap_t **pd, int *linktype, char *errbuf) ++try_dev(char *interface, pcap_t **pd, int *linktype, int promisc, char *errbuf) + { + register int snaplen, timeout; + +@@ -170,7 +170,7 @@ try_dev(char *interface, pcap_t **pd, in + sizeof(struct fddi_header)) + sizeof(struct ether_arp); + timeout = 1000; + +- *pd = pcap_open_live(interface, snaplen, 1, timeout, errbuf); ++ *pd = pcap_open_live(interface, snaplen, promisc, timeout, errbuf); + if (NULL == *pd) { + syslog(LOG_ERR, "pcap open %s: %s", interface, errbuf); + return NULL; +@@ -187,14 +187,14 @@ try_dev(char *interface, pcap_t **pd, in + } + + char * +-iterate_dev(char *arginterface, pcap_t **pd, int *linktype, char *errbuf) ++iterate_dev(char *arginterface, pcap_t **pd, int *linktype, int promisc, char *errbuf) + { + static char interface[IF_NAMESIZE + 1]; + pcap_if_t *alldevs; + pcap_if_t *dev; + + if (NULL != arginterface) { +- return try_dev(arginterface, pd, linktype, errbuf); ++ return try_dev(arginterface, pd, linktype, promisc, errbuf); + } else { + if (pcap_findalldevs(&alldevs, errbuf) == -1) { + (void)fprintf(stderr, "%s: lookup_device: %s\n", +@@ -203,7 +203,7 @@ iterate_dev(char *arginterface, pcap_t * + } + for (dev = alldevs; dev && (arginterface == NULL); dev = dev->next) { + strncpy(interface, dev->name, strlen(dev->name)+1); +- arginterface = try_dev(interface, pd, linktype, errbuf); ++ arginterface = try_dev(interface, pd, linktype, promisc, errbuf); + } + pcap_freealldevs(alldevs); + return arginterface; +@@ -224,6 +224,7 @@ main(int argc, char **argv) + struct bpf_program code; + char errbuf[PCAP_ERRBUF_SIZE]; + char* serveruser = NULL; ++ int promisc = 1; + + if (argv[0] == NULL) + prog = "arpwatch"; +@@ -242,7 +243,7 @@ main(int argc, char **argv) + linktype = -1; + rfilename = NULL; + pd = NULL; +- while ((op = getopt(argc, argv, "df:i:n:Nr:u:e:s:")) != EOF) ++ while ((op = getopt(argc, argv, "df:i:n:Nr:u:e:s:p")) != EOF) + switch (op) { + + case 'd': +@@ -304,6 +305,10 @@ main(int argc, char **argv) + } + break; + ++ case 'p': ++ --promisc; ++ break; ++ + default: + usage(); + } +@@ -317,7 +322,7 @@ main(int argc, char **argv) + } else { + + /* Determine interface if not specified */ +- interface = iterate_dev(interface, &pd, &linktype, errbuf); ++ interface = iterate_dev(interface, &pd, &linktype, promisc, errbuf); + if (interface == NULL) { + (void)fprintf(stderr, "%s: lookup_device: no suitable interface found\n", + prog); diff --git a/SPECS/arpwatch.spec b/SPECS/arpwatch.spec index ced28fc..828fcf5 100644 --- a/SPECS/arpwatch.spec +++ b/SPECS/arpwatch.spec @@ -4,7 +4,7 @@ Name: arpwatch Epoch: 14 Version: 2.1a15 -Release: 30%{?dist} +Release: 33%{?dist} Summary: Network monitoring tools for tracking IP addresses on a network Group: Applications/System License: BSD with advertising @@ -14,7 +14,7 @@ Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units Requires: /usr/sbin/sendmail -BuildRequires: /usr/sbin/sendmail libpcap-devel +BuildRequires: /usr/sbin/sendmail libpcap-devel systemd Source0: ftp://ftp.ee.lbl.gov/arpwatch-%{version}.tar.gz Source1: arpwatch.service @@ -41,6 +41,7 @@ Patch15: arpwatch-2.1a15-lookupiinvalid.patch Patch16: arpwatch-201301-ethcodes.patch Patch17: arpwatch-pie.patch Patch18: arpwatch-aarch64.patch +Patch19: arpwatch-promisc.patch %description The arpwatch package contains arpwatch and arpsnmp. Arpwatch and @@ -73,6 +74,7 @@ network. %patch16 -p1 -b .ethcode %patch17 -p1 -b .pie %patch18 -p1 -b .aarch64 +%patch19 -p1 -b .promisc %build %configure @@ -152,6 +154,15 @@ fi %attr(0644,-,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{_vararpwatch}/ethercodes.dat %changelog +* Mon Apr 18 2016 Jan Synáček - 14:2.1a15-33 +- fix typo in arpwatch-promisc.patch (#1291722) + +* Thu Mar 3 2016 Jan Synáček - 14:2.1a15-32 +- fix FTBFS (#1313890) + +* Wed Mar 2 2016 Jan Synáček - 14:2.1a15-31 +- add -p option that disables promiscuous mode (#1291722) + * Fri Jan 24 2014 Daniel Mach - 14:2.1a15-30 - Mass rebuild 2014-01-24 @@ -165,7 +176,7 @@ fi * Wed Feb 13 2013 Fedora Release Engineering - 14:2.1a15-27 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild -* Thu Jan 18 2013 Ales Ledvinka - 14:2.1a15-26 +* Thu Jan 17 2013 Ales Ledvinka - 14:2.1a15-26 - fix permissions related to collected database - update ethcodes defaults to current public IEEE OUI-32