Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 783195 - net-analyzer/arpwatch-3.1-r2: all vendors <unknown>, opens ethercodes.dat from wrong directory
Summary: net-analyzer/arpwatch-3.1-r2: all vendors <unknown>, opens ethercodes.dat fro...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Netmon Herd
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-16 18:49 UTC by Ondrej Zary
Modified: 2021-05-31 19:30 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,19.38 KB, text/plain)
2021-04-17 15:22 UTC, Ondrej Zary
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ondrej Zary 2021-04-16 18:49:43 UTC
Since upgrading arpwatch from 2.1.15-r11 to 3.1-r2, all e-mails contain <unknown> for all vendors. /usr/share/arpwatch/ethercodes.dat is present.

Tried to update it, only to find that the /usr/sbin/update-ethercodes.sh script is completely broken (wtf is arp.dat?):
# /usr/sbin/update-ethercodes.sh
/usr/sbin/update-ethercodes.sh: line 11: cd: /usr/local/arpwatch: No such file or directory
# mkdir /usr/local/arpwatch
# /usr/sbin/update-ethercodes.sh
/usr/sbin/update-ethercodes.sh: line 32: ./massagevendor: No such file or directory

Updated manually (/usr/bin/wget -O - http://standards-oui.ieee.org/oui/oui.csv | /usr/sbin/massagevendor.py >/usr/share/arpwatch/ethercodes.dat.new && mv /usr/share/arpwatch/ethercodes.dat.new /usr/share/arpwatch/ethercodes.dat
) but it did not help.

Strace shows that arpwatch tries to open ethercodes.dat from the current working directory!
openat(AT_FDCWD, "ethercodes.dat", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)

Reproducible: Always

Steps to Reproduce:
1. start arpwatch
2. change IP address of a device in the network
3. check the mail you receive
Actual Results:  
    ethernet address: 60:57:18:xx:xx:xx
     ethernet vendor: <unknown>
old ethernet address: 0:23:6c:xx:xx:xx
 old ethernet vendor: <unknown>

Expected Results:  
    ethernet address: 60:57:18:xx:xx:xx
     ethernet vendor: Intel Corporate
old ethernet address: 0:23:6c:xx:xx:xx
 old ethernet vendor: Apple, Inc.

Portage 3.0.17 (python 3.8.8-final-0, default/linux/x86/17.0, gcc-10.2.0, glibc-2.32-r7, 5.10.27-gentoo-main i686)
=================================================================
System uname: Linux-5.10.27-gentoo-main-i686-Intel-R-_Celeron-TM-_CPU_1300MHz-with-glibc2.1.3
KiB Mem:      512200 total,     31212 free
KiB Swap:    1012920 total,    934320 free
Timestamp of repository gentoo: Fri, 16 Apr 2021 01:00:01 +0000
Head commit of repository gentoo: 6c33c6d5084918a9d8625ea9324a5536ad082f3f
sh bash 5.0_p18
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          3.8.8_p1::gentoo, 3.9.2_p1::gentoo
dev-util/cmake:           3.18.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.2.0-r5::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r7::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: no
    sync-rsync-extra-opts: --exclude-from=/etc/portage/sync.exclude

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=i686 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -march=i686 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://mirror.wheel.sk/gentoo ftp://tux.rainside.sk/gentoo/ ftp://ftp.fi.muni.cz/pub/linux/gentoo/ ftp://gentoo.mirror.web4u.cz/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en sk"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/sync.exclude"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp/portage"
USE="apache2 bzip2 caps chroot cli crypt dri gmp iconv idn imap ipv6 jpeg libglvnd libtirpc mbox mmx ncurses nls nptl nptlonly pam pcre pdflib png readline seccomp split-usr ssl tcpd truetype unicode urandom x86 xattr zlib" ABI_X86="32" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="alias auth_basic auth_digest authn_core authn_default authn_file authz_core authz_default authz_groupfile authz_host authz_owner authz_user autoindex cgi dbd deflate dir env expires ext_filter filter headers info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb status unixd unique_id usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en sk" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, RUSTFLAGS
Comment 1 Ondrej Zary 2021-04-16 19:03:01 UTC
In fact, it does this before the open:
chdir("/")                              = 0
chdir("/usr/arpwatch")                  = -1 ENOENT (No such file or directory)

Symlinking /usr/arpwatch to /usr/share/arpwatch allows it to read the ethercodes.dat file.
Comment 2 Ondrej Zary 2021-04-17 15:22:48 UTC
Created attachment 700392 [details]
build.log

--datadir=/usr/share here:
./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/arpwatch-3.1-r2 --htmldir=/usr/share/doc/arpwatch-3.1-r2/html --libdir=/usr/lib

-DARPDIR=\"/usr/arpwatch here:
i686-pc-linux-gnu-gcc -O3 -march=i686 -fomit-frame-pointer   -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D__EXTENSIONS__=1 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS=1 -D_TANDEM_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DHAVE_FCNTL_H=1 -DHAVE_MEMORY_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_FREEBSD_TRUE=# -DHAVE_FREEBSD_FALSE=1 -DHAVE_MALLOC_H=1 -DHAVE_STRERROR=1 -DMANCFLAG=\(default\) -DZEROPAD=0 -DRETSIGTYPE=void -DRETSIGVAL=/\*\*/ -DHAVE_SIGSET=1 -Dsignal=sigset -DDECLWAITSTATUS=int -DHAVE_LIBRESOLV=1 -DHAVE_PCAP_FINDALLDEVS=1 -DHAVE_DN_SKIPNAME=1 -DWATCHER=\"root\" -DWATCHEE=\"arpwatch\" -DARPDIR=\"/usr/arpwatch\" -DPATH_SENDMAIL=\"/usr/sbin/sendmail\" -I.  -I/usr/local/include -c ./arpwatch.c