Package: pppoeconf
Version: 1.20
Severity: serious
Tags: patch

Hi

pppoeconf depends on ifupdown and net-tools (ifconfig) without 
declaring an explicit dependency on either of these packages. Due to
ifupdown having switched its own reliance on net-tools to iproute2,
new jessie installs are particularly prone to this problem, as ifconfig
is no longer guaranteed to be available.

Rather than just declaring net-tools as a dependency, I've ported 
pppoeconf to use iproute2 instead, thereby following ifupdown and 
reducing the dependency chain as a whole. Existing configurations will 
not be migrated to iproute2 automatically, as doing so would be a 
policy violation, but existing -upgraded- installations should still
have net-tools/ ifconfig available (and pppoeconf will adapt it when
reconfiguring an interface).

I'll follow up this bug with a, tested, 2-patch patch series (which 
also fixes the newly introduced i18n changes), once I receive the bug 
number, but the changes are basically these:

*** Please apply the two patches mailed as follow-up to this bug, ***
*** rather than this patch which is only meant for demonstrating  ***
*** the changes                                                   ***
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Standards-Version: 3.9.2
 
 Package: pppoeconf
 Architecture: all
-Depends: ${misc:Depends}, whiptail-provider | whiptail, ppp (>= 
2.4.2+20040428-2) | pppoe (>= 3.0), ppp (>= 2.4.1.uus2-4), gettext-base (>= 
0.13), sed (>= 3.95)
+Depends: ${misc:Depends}, whiptail-provider | whiptail, ppp (>= 
2.4.2+20040428-2) | pppoe (>= 3.0), ppp (>= 2.4.1.uus2-4), gettext-base (>= 
0.13), sed (>= 3.95), ifupdown (>= 0.7.44~), iproute2
 Recommends: locales
 Suggests: xdialog
 Description: configures PPPoE/ADSL connections
--- a/pppoeconf
+++ b/pppoeconf
@@ -101,7 +101,7 @@ if test "$*" ; then
    list="$*"
    force_manual=1
 else
-   list=$( LANG=C /sbin/ifconfig -a | grep "Ethernet" | grep -v irlan | cut 
-f1 -d" " )
+   list=$( LANG=C /bin/ip -f link -o addr list | awk 
'/^[0-9]*\:.*link\/ether/{print $2}' | grep -v irlan | cut -f1 -d: )
 fi
 
 if test "$list" ; then
@@ -189,7 +189,7 @@ Webnetix:
             fi
 
             touch $TMP/pppoe.scan
-            ifconfig $iface up
+            ip link set $iface up
             ($DISCOVERY_PROGRAM $mmm -A -I $iface > $TMP/$iface.pppoe ; rm 
$TMP/pppoe.scan) &
 
             ( time=0 ; while test -f $TMP/pppoe.scan ; do time=`expr $time + 
6`; echo $time; sleep 1; done ) | $DIALOG --title "$title" --gauge "$text 
$mmode" 10 60 0
@@ -253,9 +253,12 @@ Continue with configuration?')
          # interface activation code - this sucks here, pppd plugin should do 
it as needed
          #sed -i -e "s,pre-up 
/sbin/ifconfig[[:space:]]\+[^[:space:]]\+[[:space:]]\+up.#.line.maintained.by.pppoeconf,pre-up
 /sbin/ifconfig $ifacenocomma up # line maintained by pppoeconf," $INTFILE
     # FIXME: Make sure that it gets added to correct iface stanza! (Because 
it's not always added above)
-    PATTERN_PREUP_IFACE="pre-up 
/sbin/ifconfig[[:space:]]\+[^[:space:]]\+[[:space:]]\+up.#.line.maintained.by.pppoeconf"
-    REPLACE_PREUP_IFACE="pre-up /sbin/ifconfig $ifacenocomma up # line 
maintained by pppoeconf"
-    if grep -q "$PATTERN_PREUP_IFACE" $INTFILE; then 
+    PATTERN_PREUP_IFACE_LEGACY="pre-up 
/sbin/ifconfig[[:space:]]\+[^[:space:]]\+[[:space:]]\+up.#.line.maintained.by.pppoeconf"
+    PATTERN_PREUP_IFACE="pre-up /bin/ip link 
set[[:space:]]\+[^[:space:]]\+[[:space:]]\+up.#.line.maintained.by.pppoeconf"
+    REPLACE_PREUP_IFACE="pre-up /bin/ip link set $ifacenocomma up # line 
maintained by pppoeconf"
+    if grep -q "$PATTERN_PREUP_IFACE_LEGACY" $INTFILE; then
+        sed -i -e "s,$PATTERN_PREUP_IFACE_LEGACY,$REPLACE_PREUP_IFACE," 
$INTFILE
+    elif grep -q "$PATTERN_PREUP_IFACE" $INTFILE; then
         sed -i -e "s,$PATTERN_PREUP_IFACE,$REPLACE_PREUP_IFACE," $INTFILE
     else
         sed -i -e "s,[^#]*\(iface dsl-provider.*\),\1\n$REPLACE_PREUP_IFACE," 
$INTFILE
@@ -461,7 +464,7 @@ Note that this situation is not expected and you should 
consider submitting a bu
       cd /
       pon dsl-provider
       title=$(gettext 'CONNECTION INITIATED')
-      text=$(gettext 'The DSL connection has been triggered. You can use the 
"plog" command to see the status or "ifconfig ppp0" for general interface 
info.')
+      text=$(gettext 'The DSL connection has been triggered. You can use the 
"plog" command to see the status or "ip addr show ppp0" for general interface 
info.')
       $DIALOG --title "$title" --clear --msgbox "$text" 10 60
       ;;
     1)
*** Please apply the two patches mailed as follow-up to this bug, ***
*** rather than this patch which is only meant for demonstrating  ***
*** the changes                                                   ***

Regards
        Stefan Lippers-Hollmann

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.11-6.slh.3-aptosid-amd64 (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to