Do not leak wireless options into non-wireless device configurations on concurrent...
authorMichael Prokop <mika@grml.org>
Sat, 18 Jul 2020 14:29:05 +0000 (16:29 +0200)
committerMichael Prokop <mika@grml.org>
Sat, 18 Jul 2020 14:33:41 +0000 (16:33 +0200)
commitf512c908edc331ca6a87bb83a8ae06e630d2e040
tree9d010caff71c5a9353b2b087fe73319e85ed16de
parent5569e6318b576f4f1faea9bdfee66662b0c4ce24
Do not leak wireless options into non-wireless device configurations on concurrent runs

When configuring a wlan device *and* afterwards a non-wlan device
within the same netcardconfig invocation, the wireless configuration
is still around (via $IWOURLINE and its underlying writeiwline()).

This causes the wireless options to be present even if not applicable,
like for example (wlan0 was configured first, then eth0 afterwards):

| allow-hotplug eth0
| iface wlan0 inet dhcp
|   wireless-mode Managed
|   wireless-essid SECRET
|   wpa-ssid SECRET
|   wpa-psk SECRET
|
|
| iface eth0 inet static
|         address 10.42.42.1
|         netmask 255.255.255.0
|         network 10.42.42.0
|         broadcast 10.42.42.255
|         gateway 10.42.42.1
|         dns-nameservers 10.42.42.1
| wireless-mode Managed
| wireless-essid SECRET
| wpa-ssid SECRET
| wpa-psk SECRET

This work was funded by Grml-Forensic.
sbin/netcardconfig