Compare commits
18 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acc2822ccb | ||
|
|
978fc80b2d | ||
|
|
542ff4a5ed | ||
|
|
e1b708a1f7 | ||
|
|
59d0c1bf4b | ||
|
|
a532a32f3b | ||
|
|
3986572b51 | ||
|
|
eef2e2bb6c | ||
|
|
907bada553 | ||
|
|
06db5d5fed | ||
|
|
dc790c3128 | ||
|
|
39853e8a2c | ||
|
|
20668574b3 | ||
|
|
20c9f98b11 | ||
|
|
ee3d67baab | ||
|
|
b14be0a356 | ||
|
|
80fac7b9d9 | ||
|
|
f1bf8d9972 |
8 changed files with 21857 additions and 19607 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -3,3 +3,7 @@
|
||||||
/arpwatch-3.1.tar.gz
|
/arpwatch-3.1.tar.gz
|
||||||
/arpwatch-3.2.tar.gz
|
/arpwatch-3.2.tar.gz
|
||||||
/arpwatch-3.3.tar.gz
|
/arpwatch-3.3.tar.gz
|
||||||
|
/arpwatch-3.4.tar.gz
|
||||||
|
/arpwatch-3.5.tar.gz
|
||||||
|
/arpwatch-3.6.tar.gz
|
||||||
|
/arpwatch-3.7.tar.gz
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
When arpwatch is terminated cleanly by a signal (INT/TERM/HUP) handler, the
|
|
||||||
exit code should be zero for success instead of nonzero for failure.
|
|
||||||
|
|
||||||
diff -Naur arpwatch-3.1-original/arpwatch.c arpwatch-3.1/arpwatch.c
|
|
||||||
--- arpwatch-3.1-original/arpwatch.c 2019-11-30 13:35:23.000000000 -0500
|
|
||||||
+++ arpwatch-3.1/arpwatch.c 2020-11-08 12:55:51.429575973 -0500
|
|
||||||
@@ -892,7 +892,7 @@
|
|
||||||
|
|
||||||
lg(LOG_DEBUG, "exiting");
|
|
||||||
checkpoint(0);
|
|
||||||
- exit(1);
|
|
||||||
+ exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
RETSIGTYPE
|
|
||||||
|
|
@ -1,15 +1,8 @@
|
||||||
When -i is not given, iterate all available devices until a usable one is found
|
diff -Naur arpwatch-3.5-original/arpwatch.c arpwatch-3.5/arpwatch.c
|
||||||
instead of just trying the first one and giving up if it is not usable. See
|
--- arpwatch-3.5-original/arpwatch.c 2023-12-03 13:10:05.000000000 -0500
|
||||||
RHBZ #842660.
|
+++ arpwatch-3.5/arpwatch.c 2023-12-03 20:06:32.694857659 -0500
|
||||||
|
@@ -163,6 +163,8 @@
|
||||||
Additionally, handle the case where a device provides both supported and
|
void hup(int);
|
||||||
unsupported datalink types.
|
|
||||||
|
|
||||||
diff -Naur arpwatch-3.1-original/arpwatch.c arpwatch-3.1/arpwatch.c
|
|
||||||
--- arpwatch-3.1-original/arpwatch.c 2019-11-30 13:35:23.000000000 -0500
|
|
||||||
+++ arpwatch-3.1/arpwatch.c 2021-04-24 09:02:50.762535242 -0400
|
|
||||||
@@ -161,6 +161,8 @@
|
|
||||||
RETSIGTYPE die(int);
|
|
||||||
int isbogon(u_int32_t);
|
int isbogon(u_int32_t);
|
||||||
int main(int, char **);
|
int main(int, char **);
|
||||||
+int try_open_live(pcap_t ** pd_ptr, char const * interface_name,
|
+int try_open_live(pcap_t ** pd_ptr, char const * interface_name,
|
||||||
|
|
@ -17,7 +10,7 @@ diff -Naur arpwatch-3.1-original/arpwatch.c arpwatch-3.1/arpwatch.c
|
||||||
void process_ether(u_char *, const struct pcap_pkthdr *, const u_char *);
|
void process_ether(u_char *, const struct pcap_pkthdr *, const u_char *);
|
||||||
void process_fddi(u_char *, const struct pcap_pkthdr *, const u_char *);
|
void process_fddi(u_char *, const struct pcap_pkthdr *, const u_char *);
|
||||||
int readsnmp(char *);
|
int readsnmp(char *);
|
||||||
@@ -177,7 +179,7 @@
|
@@ -179,7 +181,7 @@
|
||||||
int op, snaplen, timeout, linktype, status;
|
int op, snaplen, timeout, linktype, status;
|
||||||
pcap_t *pd;
|
pcap_t *pd;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
@ -26,7 +19,7 @@ diff -Naur arpwatch-3.1-original/arpwatch.c arpwatch-3.1/arpwatch.c
|
||||||
char *interface, *rfilename;
|
char *interface, *rfilename;
|
||||||
struct bpf_program code;
|
struct bpf_program code;
|
||||||
char errbuf[PCAP_ERRBUF_SIZE];
|
char errbuf[PCAP_ERRBUF_SIZE];
|
||||||
@@ -309,13 +311,18 @@
|
@@ -311,13 +313,18 @@
|
||||||
"%s: pcap_findalldevs: %s\n", prog, errbuf);
|
"%s: pcap_findalldevs: %s\n", prog, errbuf);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
@ -48,7 +41,7 @@ diff -Naur arpwatch-3.1-original/arpwatch.c arpwatch-3.1/arpwatch.c
|
||||||
#else
|
#else
|
||||||
if (interface = pcap_lookupdev(errbuf)) == NULL) {
|
if (interface = pcap_lookupdev(errbuf)) == NULL) {
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
@@ -354,15 +361,12 @@
|
@@ -356,15 +363,12 @@
|
||||||
}
|
}
|
||||||
swapped = pcap_is_swapped(pd);
|
swapped = pcap_is_swapped(pd);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -68,7 +61,7 @@ diff -Naur arpwatch-3.1-original/arpwatch.c arpwatch-3.1/arpwatch.c
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
swapped = 1;
|
swapped = 1;
|
||||||
#endif
|
#endif
|
||||||
@@ -452,6 +456,74 @@
|
@@ -454,6 +458,74 @@
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
12
arpwatch-3.5-exitcode.patch
Normal file
12
arpwatch-3.5-exitcode.patch
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
diff -Naur arpwatch-3.5-original/arpwatch.c arpwatch-3.5/arpwatch.c
|
||||||
|
--- arpwatch-3.5-original/arpwatch.c 2023-12-03 13:10:05.000000000 -0500
|
||||||
|
+++ arpwatch-3.5/arpwatch.c 2023-12-03 20:04:01.834691097 -0500
|
||||||
|
@@ -915,7 +915,7 @@
|
||||||
|
{
|
||||||
|
lg(LOG_DEBUG, "exiting");
|
||||||
|
checkpoint(0);
|
||||||
|
- exit(1);
|
||||||
|
+ exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
Name: arpwatch
|
Name: arpwatch
|
||||||
Epoch: 14
|
Epoch: 14
|
||||||
Version: 3.3
|
Version: 3.7
|
||||||
Release: %autorelease
|
Release: %autorelease
|
||||||
Summary: Network monitoring tools for tracking IP addresses on a network
|
Summary: Network monitoring tools for tracking IP addresses on a network
|
||||||
|
|
||||||
|
|
@ -25,6 +25,7 @@ BuildRequires: gcc
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: /usr/sbin/sendmail
|
BuildRequires: /usr/sbin/sendmail
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
|
%{?sysuser_requires_compat}
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
BuildRequires: libpcap-devel
|
BuildRequires: libpcap-devel
|
||||||
|
|
||||||
|
|
@ -37,12 +38,13 @@ Source0: https://ee.lbl.gov/downloads/arpwatch/arpwatch-%{version}.tar.gz
|
||||||
# updated), we store the file directly in the repository with the spec file;
|
# updated), we store the file directly in the repository with the spec file;
|
||||||
# see the update-oui-csv script.
|
# see the update-oui-csv script.
|
||||||
#
|
#
|
||||||
# File oui.csv last fetched 2023-07-13T04:40:59+00:00.
|
# File oui.csv last fetched 2024-10-31T18:34:17+00:00.
|
||||||
Source1: oui.csv
|
Source1: oui.csv
|
||||||
Source2: arpwatch.service
|
Source2: arpwatch.service
|
||||||
Source3: arpwatch.sysconfig
|
Source3: arpwatch.sysconfig
|
||||||
Source4: arp2ethers.8
|
Source4: arp2ethers.8
|
||||||
Source5: massagevendor.8
|
Source5: massagevendor.8
|
||||||
|
Source6: arpwatch.sysusers
|
||||||
|
|
||||||
# The latest versions of all “arpwatch-3.1-*” patches were sent upstream by
|
# The latest versions of all “arpwatch-3.1-*” patches were sent upstream by
|
||||||
# email 2021-04-24.
|
# email 2021-04-24.
|
||||||
|
|
@ -69,12 +71,12 @@ Patch: arpwatch-3.1-configure-no-local-pcap.patch
|
||||||
Patch: arpwatch-3.1-all-zero-bogon.patch
|
Patch: arpwatch-3.1-all-zero-bogon.patch
|
||||||
# When arpwatch is terminated cleanly by a signal (INT/TERM/HUP) handler, the
|
# When arpwatch is terminated cleanly by a signal (INT/TERM/HUP) handler, the
|
||||||
# exit code should be zero for success instead of nonzero for failure.
|
# exit code should be zero for success instead of nonzero for failure.
|
||||||
Patch: arpwatch-3.1-exitcode.patch
|
Patch: arpwatch-3.5-exitcode.patch
|
||||||
# When -i is not given, do not just try the first device found, but keep
|
# When -i is not given, do not just try the first device found, but keep
|
||||||
# checking devices until a usable one is found, if any is available.
|
# checking devices until a usable one is found, if any is available.
|
||||||
# Additionally, handle the case where a device provides both supported and
|
# Additionally, handle the case where a device provides both supported and
|
||||||
# unsupported datalink types.
|
# unsupported datalink types.
|
||||||
Patch: arpwatch-3.1-devlookup.patch
|
Patch: arpwatch-3.5-devlookup.patch
|
||||||
|
|
||||||
# Replace _getshort(), “a glibc function that hasn't been declared in the
|
# Replace _getshort(), “a glibc function that hasn't been declared in the
|
||||||
# installed headers for many, many years,” with ns_get16(). Fixes C99
|
# installed headers for many, many years,” with ns_get16(). Fixes C99
|
||||||
|
|
@ -86,15 +88,6 @@ Patch: arpwatch-3.3-c99.patch
|
||||||
ExcludeArch: %{ix86}
|
ExcludeArch: %{ix86}
|
||||||
|
|
||||||
%global pkgstatedir %{_sharedstatedir}/arpwatch
|
%global pkgstatedir %{_sharedstatedir}/arpwatch
|
||||||
%global service_user arpwatch
|
|
||||||
%global service_group arpwatch
|
|
||||||
# Soft static UID and GID; see
|
|
||||||
# https://fedoraproject.org/wiki/Packaging:UsersAndGroups#Soft_static_allocation
|
|
||||||
# for information, and the uidgid file in the setup package
|
|
||||||
# (https://pagure.io/setup/blob/master/f/uidgid) for the list of allocations,
|
|
||||||
# including the one for arpwatch.
|
|
||||||
%global service_uid 77
|
|
||||||
%global service_gid 77
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The arpwatch package contains arpwatch and arpsnmp. Arpwatch and arpsnmp are
|
The arpwatch package contains arpwatch and arpsnmp. Arpwatch and arpsnmp are
|
||||||
|
|
@ -128,11 +121,20 @@ awk '/^ \* / { print substr($0, 4); } /^ \*\// { exit }' arpwatch.c |
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
# Prior to version 3.4, this was handled by the configure script. If it is not
|
||||||
|
# defined, the build fails because time.h is not included in report.c. This
|
||||||
|
# regregression was reported upstream by email to arpwatch@ee.lbl.gov on
|
||||||
|
# 2023-09-06.
|
||||||
|
export CPPFLAGS="${CPPFLAGS-} -DTIME_WITH_SYS_TIME=1"
|
||||||
|
|
||||||
%configure --with-sendmail=/usr/sbin/sendmail PYTHON=%{python3}
|
%configure --with-sendmail=/usr/sbin/sendmail PYTHON=%{python3}
|
||||||
|
|
||||||
%make_build ARPDIR=%{pkgstatedir}
|
%make_build ARPDIR=%{pkgstatedir}
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
install -p -D -m 0644 %{SOURCE6} '%{buildroot}%{_sysusersdir}/arpwatch.conf'
|
||||||
|
|
||||||
# The upstream Makefile does not create the directories it requires, so we must
|
# The upstream Makefile does not create the directories it requires, so we must
|
||||||
# do it manually. Additionally, it attempts to comment out the installation of
|
# do it manually. Additionally, it attempts to comment out the installation of
|
||||||
# the init script on non-FreeBSD platforms, but this does not quite work as
|
# the init script on non-FreeBSD platforms, but this does not quite work as
|
||||||
|
|
@ -193,22 +195,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
getent group %{service_group} >/dev/null ||
|
%sysusers_create_compat %{SOURCE6}
|
||||||
groupadd -f -g %{service_gid} -r %{service_group}
|
|
||||||
if ! getent passwd %{service_user} >/dev/null
|
|
||||||
then
|
|
||||||
if ! getent passwd %{service_uid} >/dev/null
|
|
||||||
then
|
|
||||||
useradd -r -u %{service_uid} -g %{service_group} \
|
|
||||||
-d %{pkgstatedir} -s /sbin/nologin \
|
|
||||||
-c "Service user for arpwatch" %{service_user}
|
|
||||||
else
|
|
||||||
useradd -r -g %{service_group} \
|
|
||||||
-d %{pkgstatedir} -s /sbin/nologin \
|
|
||||||
-c "Service user for arpwatch" %{service_user}
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
|
|
@ -239,13 +226,14 @@ exit 0
|
||||||
%attr(0644,-,-) %{_mandir}/man8/*.8*
|
%attr(0644,-,-) %{_mandir}/man8/*.8*
|
||||||
|
|
||||||
%{_unitdir}/arpwatch.service
|
%{_unitdir}/arpwatch.service
|
||||||
|
%{_sysusersdir}/arpwatch.conf
|
||||||
%config(noreplace) %{_sysconfdir}/sysconfig/arpwatch
|
%config(noreplace) %{_sysconfdir}/sysconfig/arpwatch
|
||||||
|
|
||||||
%attr(1775,-,%{service_group}) %dir %{pkgstatedir}
|
%attr(1775,-,arpwatch) %dir %{pkgstatedir}
|
||||||
%attr(0644,%{service_user},%{service_group}) %verify(not md5 size mtime) %config(noreplace) %{pkgstatedir}/arp.dat
|
%attr(0644,arpwatch,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{pkgstatedir}/arp.dat
|
||||||
%attr(0644,%{service_user},%{service_group}) %verify(not md5 size mtime) %config(noreplace) %{pkgstatedir}/arp.dat-
|
%attr(0644,arpwatch,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{pkgstatedir}/arp.dat-
|
||||||
%attr(0600,%{service_user},%{service_group}) %verify(not md5 size mtime) %ghost %{pkgstatedir}/arp.dat.new
|
%attr(0600,arpwatch,arpwatch) %verify(not md5 size mtime) %ghost %{pkgstatedir}/arp.dat.new
|
||||||
%attr(0644,-,%{service_group}) %verify(not md5 size mtime) %config(noreplace) %{pkgstatedir}/ethercodes.dat
|
%attr(0644,-,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{pkgstatedir}/ethercodes.dat
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|
|
||||||
2
arpwatch.sysusers
Normal file
2
arpwatch.sysusers
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
#Type Name ID GECOS Home directory Shell
|
||||||
|
u arpwatch - "Service user for arpwatch" /var/lib/arpwatch /sbin/nologin
|
||||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
||||||
SHA512 (arpwatch-3.3.tar.gz) = 4e3d542917dc9060ae7b35b40f41cb696eb36e68846194a76f025c5ecb1df1e67d5c1c66ba3c7e581e1f915b988d05cb7805f28d410784bd27dc3a448dccdece
|
SHA512 (arpwatch-3.7.tar.gz) = 8bdda7fc94241813ee57c91683ce5c6a8e4d5e66255bf2cc302d69763086e29c6548b009805660274437edca7a5b8bbf24566846357afe1f96015bd26db89624
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue