Package: release.debian.org
User: release.debian....@packages.debian.org
Usertags: unblock
Severity: normal

unblock macchanger/1.7.0-4

The new behavior of this package to automatically enable itself surprised some
users, and broke one's custom wifi setup.  So this update adds a debconf
question to prompt the user whether to run it automatically or not.


$ debdiff /tmp/macchanger_1.7.0-3.2.dsc macchanger_1.7.0-4.dsc
diff -Nru macchanger-1.7.0/debian/changelog macchanger-1.7.0/debian/changelog
--- macchanger-1.7.0/debian/changelog   2014-11-29 13:50:42.000000000 +0100
+++ macchanger-1.7.0/debian/changelog   2014-12-15 14:11:01.000000000 +0100
@@ -1,3 +1,9 @@
+macchanger (1.7.0-4) unstable; urgency=low
+
+  * add debconf option to prompt whether to automatically run (Closes: #768189)
+
+ -- Hans-Christoph Steiner <h...@eds.org>  Mon, 15 Dec 2014 12:07:44 +0100
+
 macchanger (1.7.0-3.2) unstable; urgency=medium

   * Non-maintainer upload.
diff -Nru macchanger-1.7.0/debian/config macchanger-1.7.0/debian/config
--- macchanger-1.7.0/debian/config      1970-01-01 01:00:00.000000000 +0100
+++ macchanger-1.7.0/debian/config      2014-12-15 14:07:56.000000000 +0100
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+
+if [ -f /etc/default/macchanger ]; then
+    ENABLE_ON_POST_UP_DOWN=false
+    . /etc/default/macchanger
+
+    if [ "$ENABLE_ON_POST_UP_DOWN" = "true" ]; then
+        db_set macchanger/automatically_run true
+    else
+        db_set macchanger/automatically_run false
+    fi
+fi
+
+db_input high macchanger/automatically_run || true
+db_go
+
+#DEBHELPER#
+
+exit 0
diff -Nru macchanger-1.7.0/debian/default macchanger-1.7.0/debian/default
--- macchanger-1.7.0/debian/default     1970-01-01 01:00:00.000000000 +0100
+++ macchanger-1.7.0/debian/default     2014-12-15 14:11:01.000000000 +0100
@@ -0,0 +1,11 @@
+# before bringing up any network interface, run macchanger. Careful, this is
+# not guaranteed to prevent leaking your real MAC address before the new one
+# gets assigned!
+#
+ENABLE_ON_POST_UP_DOWN=false
+
+
+# by default, macchanger runs on all network interfaces but loopback (lo).  If
+# you only want it to run on specific network interfaces, set them here:
+#
+#ENABLE_INTERFACES="wlan0"
diff -Nru macchanger-1.7.0/debian/if-pre-up.d/macchanger
macchanger-1.7.0/debian/if-pre-up.d/macchanger
--- macchanger-1.7.0/debian/if-pre-up.d/macchanger      2014-11-29
13:50:42.000000000 +0100
+++ macchanger-1.7.0/debian/if-pre-up.d/macchanger      1970-01-01
01:00:00.000000000 +0100
@@ -1,32 +0,0 @@
-#!/bin/sh
-#
-# randomize MAC address before connecting to wifi or ethernet
-#
-# This script should always be run in if-pre-up.d, but unfortunately
-# NetworkManager does not run if-pre-up.d scripts before it sets up a network
-# connection (https://bugzilla.gnome.org/show_bug.cgi?id=387832).
-# if-post-down.d scripts are run, so there is a symlink to this script
-# there. That means when running network config from the terminal, macchanger
-# will be run twice, but it'll only be run in if-post-down.d when using
-# NetworkManager.
-
-package=macchanger
-
-. /etc/default/${package}
-
-LOGFILE=/var/log/${package}.log
-
-if [ "$ENABLE_ON_POST_DOWN" != "yes" ]; then
-    echo "disabled in /etc/default/${package}" >> $LOGFILE
-    exit
-fi
-
-echo "IFACE = $IFACE" >> $LOGFILE
-
-# quit if we're called for the loopback
-if [ "$IFACE" = lo ]; then
-    echo "ignoring loopback" >> $LOGFILE
-       exit 0
-fi
-
-/usr/bin/${package} -e $IFACE >> $LOGFILE 2>&1
diff -Nru macchanger-1.7.0/debian/ifupdown.sh 
macchanger-1.7.0/debian/ifupdown.sh
--- macchanger-1.7.0/debian/ifupdown.sh 1970-01-01 01:00:00.000000000 +0100
+++ macchanger-1.7.0/debian/ifupdown.sh 2014-12-15 14:07:56.000000000 +0100
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# randomize MAC address before connecting to wifi or ethernet
+#
+# This script should always be run in if-pre-up.d, but unfortunately
+# NetworkManager does not run if-pre-up.d scripts before it sets up a network
+# connection (https://bugzilla.gnome.org/show_bug.cgi?id=387832).
+# if-post-down.d scripts are run, so there is a symlink to this script
+# there. That means when running network config from the terminal, macchanger
+# will be run twice, but it'll only be run in if-post-down.d when using
+# NetworkManager.
+
+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
+
+# quit if we're called for the loopback
+if [ "$IFACE" = lo ]; then
+    echo "ignoring loopback" >> $LOGFILE
+    exit 0
+fi
+
+/usr/bin/${package} -e $IFACE >> $LOGFILE 2>&1
diff -Nru macchanger-1.7.0/debian/install macchanger-1.7.0/debian/install
--- macchanger-1.7.0/debian/install     2014-11-29 13:50:42.000000000 +0100
+++ macchanger-1.7.0/debian/install     2014-12-15 11:44:29.000000000 +0100
@@ -1,2 +1,2 @@
-debian/if-pre-up.d/macchanger etc/network/if-pre-up.d/
+debian/ifupdown.sh etc/macchanger/
 debian/logrotate.d/macchanger etc/logrotate.d/
diff -Nru macchanger-1.7.0/debian/links macchanger-1.7.0/debian/links
--- macchanger-1.7.0/debian/links       2014-11-29 13:50:42.000000000 +0100
+++ macchanger-1.7.0/debian/links       2014-12-15 12:07:20.000000000 +0100
@@ -1 +1,2 @@
-etc/network/if-pre-up.d/macchanger etc/network/if-post-down.d/macchanger
+etc/macchanger/ifupdown.sh  etc/network/if-pre-up.d/macchanger
+etc/macchanger/ifupdown.sh  etc/network/if-post-down.d/macchanger
diff -Nru macchanger-1.7.0/debian/macchanger.default
macchanger-1.7.0/debian/macchanger.default
--- macchanger-1.7.0/debian/macchanger.default  2014-11-29 13:50:42.000000000 
+0100
+++ macchanger-1.7.0/debian/macchanger.default  1970-01-01 01:00:00.000000000 
+0100
@@ -1,11 +0,0 @@
-# before bringing up any network interface, run macchanger. Careful, this is
-# not guaranteed to prevent leaking your real MAC address before the new one
-# gets assigned!
-#
-ENABLE_ON_POST_DOWN=yes
-
-
-# by default, macchanger runs on all network interfaces but loopback (lo).  If
-# you only want it to run on specific network interfaces, set them here:
-#
-#ENABLE_INTERFACES="wlan0"
diff -Nru macchanger-1.7.0/debian/po/POTFILES.in
macchanger-1.7.0/debian/po/POTFILES.in
--- macchanger-1.7.0/debian/po/POTFILES.in      1970-01-01 01:00:00.000000000 
+0100
+++ macchanger-1.7.0/debian/po/POTFILES.in      2014-12-15 12:45:10.000000000 
+0100
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] templates
diff -Nru macchanger-1.7.0/debian/po/templates.pot
macchanger-1.7.0/debian/po/templates.pot
--- macchanger-1.7.0/debian/po/templates.pot    1970-01-01 01:00:00.000000000 
+0100
+++ macchanger-1.7.0/debian/po/templates.pot    2014-12-15 12:45:10.000000000 
+0100
@@ -0,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: macchanger\n"
+"Report-Msgid-Bugs-To: macchan...@packages.debian.org\n"
+"POT-Creation-Date: 2014-12-15 12:03+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <l...@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid "Would you like your MAC automatically changed?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid ""
+"macchanger can be set up to automatically run everytime a network device is "
+"brought up or down.  This then gives you a new MAC every time you plug or "
+"unplug an ethernet cable, or enable/disable wifi."
+msgstr ""
diff -Nru macchanger-1.7.0/debian/postinst macchanger-1.7.0/debian/postinst
--- macchanger-1.7.0/debian/postinst    1970-01-01 01:00:00.000000000 +0100
+++ macchanger-1.7.0/debian/postinst    2014-12-15 14:07:56.000000000 +0100
@@ -0,0 +1,50 @@
+#!/bin/sh
+# postinst script for macchanger
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "$1" in
+    configure)
+        # Update /etc/default file based on config
+        if [ -f /etc/default/macchanger ] ; then
+            # rename old variable to new name
+            sed -i 's,ENABLE_ON_POST_DOWN,ENABLE_ON_POST_UP_DOWN,g'
/etc/default/macchanger
+
+            db_get macchanger/automatically_run
+            # set variable based on $RET
+            if grep -E  ^ENABLE_ON_POST_UP_DOWN=  /etc/default/macchanger >
/dev/null; then
+                sed -i
"s/^ENABLE_ON_POST_UP_DOWN=.*$/ENABLE_ON_POST_UP_DOWN=$RET/g"
/etc/default/macchanger
+            else
+                echo "ENABLE_ON_POST_UP_DOWN=$RET" >> /etc/default/macchanger
+            fi
+        else
+            echo "/etc/default/macchanger not found, configuration failed." >&2
+        fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff -Nru macchanger-1.7.0/debian/templates macchanger-1.7.0/debian/templates
--- macchanger-1.7.0/debian/templates   1970-01-01 01:00:00.000000000 +0100
+++ macchanger-1.7.0/debian/templates   2014-12-15 12:45:10.000000000 +0100
@@ -0,0 +1,7 @@
+Template: macchanger/automatically_run
+Type: boolean
+Default: false
+_Description: Would you like your MAC automatically changed?
+ macchanger can be set up to automatically run everytime a network device
+ is brought up or down.  This then gives you a new MAC every time you plug
+ or unplug an ethernet cable, or enable/disable wifi.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to