[Bug 242673] net-mgmt/arpwatch: rc script breaks when arpwatch_interfaces contains a dot

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Dec 16 22:31:02 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242673

            Bug ID: 242673
           Summary: net-mgmt/arpwatch: rc script breaks when
                    arpwatch_interfaces contains a dot
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: leres at freebsd.org
          Reporter: dd at goboomtown.com
          Assignee: leres at freebsd.org
             Flags: maintainer-feedback?(leres at freebsd.org)

Hi,

I just installed the 3.0 update and found a bug.  Here’s how we configure
arpwatch on our firewalls:

[dd at fw1 etc]$ grep arpwatch /etc/rc.conf
arpwatch_enable="YES"
arpwatch_interfaces="lagg0.6 lagg0.7 lagg0.10"

Here’s what happened on start:

[dd at fw1 dd]$ sudo service arpwatch start
Starting arpwatch.
Version 3.0
usage: arpwatch [-CdFNpqsvzZ] [-D arpdir] [-f datafile] [-i interface]
         [-P pidfile] [-w watcher at email] [-W watchee at email]
         [-n net[/width]] [-x net[/width]] [-r file]
/usr/local/etc/rc.d/arpwatch: WARNING: failed to start arpwatch
Starting arpwatch.
Version 3.0
usage: arpwatch [-CdFNpqsvzZ] [-D arpdir] [-f datafile] [-i interface]
         [-P pidfile] [-w watcher at email] [-W watchee at email]
         [-n net[/width]] [-x net[/width]] [-r file]
/usr/local/etc/rc.d/arpwatch: WARNING: failed to start arpwatch
Starting arpwatch.
Version 3.0
usage: arpwatch [-CdFNpqsvzZ] [-D arpdir] [-f datafile] [-i interface]
         [-P pidfile] [-w watcher at email] [-W watchee at email]
         [-n net[/width]] [-x net[/width]] [-r file]
/usr/local/etc/rc.d/arpwatch: WARNING: failed to start arpwatch

Turns out it was a simple bug in the `eval` of the rc.d/arpwatch script. 
Here’s what fixed it for me:

[dd at fw1 etc]$ diff -u rc.d/arpwatch.bad rc.d/arpwatch
--- rc.d/arpwatch.bad   2019-12-16 02:02:32.000000000 -0800
+++ rc.d/arpwatch       2019-12-16 12:33:12.376475000 -0800
@@ -47,7 +47,8 @@
        if [ $cmd == start ]; then
                prep_datfile ${fn}
        fi
-       eval options=\$arpwatch_${interface}_options
+       options_interface=`echo ${interface} | tr '.' '_'`
+       eval options=\$arpwatch_${options_interface}_options
        command_args="-i ${interface} -f ${fn} -P ${pidfile} ${options}"
 }

My fix is probably a bit primitive, but should help someone make the permanent
fix.

Thanks,
Daniel

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list