Bug#994745: ifupdown: "ifup --read-environment" does not honor $EXCLUDE_INTERFACES

2021-09-21 Thread Santiago Ruano Rincón
Control: tags -1 + pending

El 20/09/21 a las 12:04, Adam Stephens escribió:
> Package: ifupdown
> Version: 0.8.36+nmu1
> Severity: normal
> Tags: patch
> 
> Dear Maintainer,
> 
> *** Reporter, please consider answering these questions, where appropriate ***
> 
> ifdown does not correctly handle excluded interfaces passed in
> $EXCLUDE_INTERFACES:
>   # EXCLUDE_INTERFACES="lo" /sbin/ifdown lo --read-environment -n
>   run-parts /etc/network/if-down.d
>   ip link set dev lo down
>   run-parts /etc/network/if-post-down.d
> 
> This appears to be caused by an issue copying the value of the
> environment variable into excludint
…

Thanks. Patch applied in the 994745 git branch.

Cheers,

 -- Santiago


signature.asc
Description: PGP signature


Bug#994745: ifupdown: "ifup --read-environment" does not honor $EXCLUDE_INTERFACES

2021-09-20 Thread Adam Stephens
Package: ifupdown
Version: 0.8.36+nmu1
Severity: normal
Tags: patch

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

ifdown does not correctly handle excluded interfaces passed in
$EXCLUDE_INTERFACES:
  # EXCLUDE_INTERFACES="lo" /sbin/ifdown lo --read-environment -n
  run-parts /etc/network/if-down.d
  ip link set dev lo down
  run-parts /etc/network/if-post-down.d

This appears to be caused by an issue copying the value of the
environment variable into excludint

*** End of the template - remove these template lines ***


-- Package-specific info:
--- /etc/network/interfaces:
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# Cloud images dynamically generate config fragments for newly
# attached interfaces. See /etc/udev/rules.d/75-cloud-ifupdown.rules
# and /etc/network/cloud-ifupdown-helper. Dynamically generated
# configuration fragments are stored in /run:
source-directory /run/network/interfaces.d

--- /etc/network/interfaces.d/50-cloud-init:
# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
auto lo
iface lo inet loopback

# control-manual eno2np0
iface eno2np0 inet dhcp
dns-nameservers 169.254.169.254
gateway 10.0.0.1

--- /run/network/interfaces.d/eno2np0:
auto eno2np0
allow-hotplug eno2np0

iface eno2np0 inet dhcp

--- /run/network/interfaces.d/eno3np1:
auto eno3np1
allow-hotplug eno3np1

iface eno3np1 inet dhcp

--- up and down scripts installed:
/etc/network/if-down.d:
total 4
-rwxr-xr-x 1 root root 256 Apr  1  2016 resolvconf

/etc/network/if-post-down.d:
total 4
-rwxr-xr-x 1 root root 138 Sep 16  2020 chrony

/etc/network/if-pre-up.d:
total 4
-rwxr-xr-x 1 root root 344 Jun 30  2016 ethtool

/etc/network/if-up.d:
total 12
-rwxr-xr-x 1 root root  817 Apr  1  2016 000resolvconf
-rwxr-xr-x 1 root root  138 Sep 16  2020 chrony
-rwxr-xr-x 1 root root 1685 Jun 30  2016 ethtool


-- System Information:
Debian Release: 10.10
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'unstable'), (500, 'testing'), 
(500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.26-oracle (SMP w/104 CPU cores)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 
(charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages ifupdown depends on:
ii  adduser   3.118
ii  iproute2  4.20.0-2+deb10u1
ii  libc6 2.32-1
ii  lsb-base  10.2019051400

Versions of packages ifupdown recommends:
ii  isc-dhcp-client [dhcp-client]  4.4.1-2+deb10u1

Versions of packages ifupdown suggests:
pn  ppp 
pn  rdnssd  

-- no debconf information
--- main.c.orig 2021-08-18 23:30:46.0 +
+++ main.c  2021-09-20 11:50:46.504588831 +
@@ -419,7 +419,7 @@
excludeint = realloc(excludeint, excludeints * sizeof 
*excludeint);
if (excludeint == NULL)
err(1, "realloc");
-   excludeint[excludeints - 1] = tok;
+   excludeint[excludeints - 1] = strdup(tok);
}
free(excludes);
}