Package: macchanger
Version: 1.7.0-5.3
Severity: important
Tags: patch

Dear Maintainer,

unfortunately setting ENABLE_INTERFACES in /etc/default/macchanger has
no effect, so even the MACs of my virtual interfaces had been set
randomly which made them stop working in turn.

Reading /etc/macchanger/ifupdown.sh I recognized that this variable is
ignored completely. I will attach a patch for
/etc/macchanger/ifupdown.sh checking if the devices occurs in
ENABLE_INTERFACES when it is set, however I need to use bash instead of
sh.

Furthermore, observing the log file (/var/log/macchanger) I noticed that
somebody tries to call the script with the option --all which is neither
supported by ifupdown.sh nor by macchanger itself.

Thank you!

Yours sincerely,
Maximilian Stein

-- System Information:
Debian Release: 8.0
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages macchanger depends on:
ii  debconf [debconf-2.0]  1.5.55
ii  dpkg                   1.17.24
ii  install-info           5.2.0.dfsg.1-6
ii  libc6                  2.19-15

macchanger recommends no packages.

macchanger suggests no packages.

-- Configuration Files:
/etc/default/macchanger changed:
ENABLE_ON_POST_UP_DOWN=true
ENABLE_INTERFACES="wlan0 eth0"

/etc/macchanger/ifupdown.sh changed:
package=macchanger
. /etc/default/${package}
LOGFILE=/var/log/${package}.log
if [ "$ENABLE_ON_POST_UP_DOWN" != "true" ]; then
    echo "disabled in /etc/default/${package}" >> $LOGFILE
    exit
fi
echo "IFACE = $IFACE" >> $LOGFILE
if [ "$IFACE" = lo ]; then
    echo "ignoring loopback" >> $LOGFILE
    exit 0
fi
if [ ! -z "$ENABLE_INTERFACES" ]; then
    if [[ ! "$ENABLE_INTERFACES" =~ "$IFACE" ]]; then
        echo "ignoring $IFACE" >> $LOGFILE
        exit 0
    fi
fi
/usr/bin/${package} -a $IFACE >> $LOGFILE 2>&1


-- debconf information:
* macchanger/automatically_run: true

--- /etc/macchanger/ifupdown.sh.bak	2015-03-09 22:53:07.066707847 +0100
+++ /etc/macchanger/ifupdown.sh	2015-03-09 23:03:32.241482116 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # randomize MAC address before connecting to wifi or ethernet
 #
@@ -29,4 +29,12 @@
     exit 0
 fi
 
+# if ENABLE_INTERFACES is set, quit if IFACE not in that list
+if [ ! -z "$ENABLE_INTERFACES" ]; then
+    if [[ ! "$ENABLE_INTERFACES" =~ "$IFACE" ]]; then
+        echo "ignoring $IFACE" >> $LOGFILE
+        exit 0
+    fi
+fi
+
 /usr/bin/${package} -a $IFACE >> $LOGFILE 2>&1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to