BTS

Issue1089

Title netcardconfig bug
Priority bug Status resolved
Superseder Nosy List info10, mika
Assigned To mika Topics

Created on 2011-12-02.12:02:49 by info10, last changed 2011-12-08.13:45:57 by mika.

Files
File name Uploaded Type Edit Remove
smime.p7s info10, 2011-12-02.12:02:48 application/pkcs7-signature
unnamed info10, 2011-12-02.12:02:48 text/html
Messages
msg4100 (view) Author: mika Date: 2011-12-08.13:45:56
We believe that your issue has been closed by the upload of
Version 0.5.1 of grml-network from Michael Prokop <mika@grml.org>.
The explanation is attached below

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 08 Dec 2011 14:32:43 +0100
Source: grml-network
Binary: grml-network
Architecture: source all
Version: 0.5.1
Distribution: unstable
Urgency: low
Maintainer: Michael Prokop <mika@grml.org>
Changed-By: Michael Prokop <mika@grml.org>
Description: 
 grml-network - network related helper scripts
Changes: 
 grml-network (0.5.1) unstable; urgency=low
 .
   * [5a1079a] netcardconfig: fix variable assignment in awk cmdline.
     Thanks to Marek Malevič. [Closes: issue1089]
Checksums-Sha1: 
 592a3a5126ba5e80b067547d16c85f9fd6f0c0b8 956 grml-network_0.5.1.dsc
 341ad9b3b13ed73c5b25c536bfbb13cd666afeb8 22011 grml-network_0.5.1.tar.gz
 ab4e09f88fa9458fbe20cd01c1f0477b53f82e4f 34268 grml-network_0.5.1_all.deb
Checksums-Sha256: 
 5ae34c0025a7490e60c36fa53b9a53db8b6dda6f458be5eee1e506a1dc13e467 956 grml-network_0.5.1.dsc
 993e51ecd1c0fea0720c648c5cd240dea3eb712909d261444aef22b27cd1af1d 22011 grml-network_0.5.1.tar.gz
 30f72d9670338fbc7741eb1ac846277e8db6c3b5301b5da36196d54e542ae2b7 34268 grml-network_0.5.1_all.deb
Files: 
 f630ab7438c130981019f127507d1b29 956 grml optional grml-network_0.5.1.dsc
 10c3babe0c81576d7a69ecdf6a5ad990 22011 grml optional grml-network_0.5.1.tar.gz
 a78556750db349107e3e79986fac6bd4 34268 grml optional grml-network_0.5.1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk7gvPwACgkQ2N9T+zficugBxwCfc/2hWT+namEo6hzI2eoT6EPY
D0EAn0Wz6g4sP9KdZoPvvc/06L0293t/
=5JfB
-----END PGP SIGNATURE-----
msg4099 (view) Author: mika Date: 2011-12-08.12:55:31
Thanks for your bugreport, fixed in git:

  http://git.io/9zOqVQ
msg4094 (view) Author: info10 Date: 2011-12-02.12:02:48
Hello,

in STABLE release of grml I found a bug reproducable with GNU awk 3.1.7 
and 3.1.8. There is this code:

       awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
         /address/{if(found){address=$NF}}
         /netmask/{if(found){netmask=$NF}}
         /broadcast/{if(found){broadcast=$NF}}
         /gateway/{if(found){gateway=$NF}}
         /dns-nameservers/{if(found){dns-nameservers=$NF}}
         END{print address" "netmask" "broadcast" "gateway" 
"dns-nameservers}' /etc/network/interfaces >"$TMP"

But when it is executed it fails with:
awk: cmd. line:5:         /dns-nameservers/{if(found){dns-nameservers=$NF}}
awk: cmd. line:5:                                                    ^ 
syntax error

The reason I believe is that character "-" is not allowed in variable 
name in awk. When replacing the code with following, it works correctly:

       awk '/iface/{if(/'"$DV"'/){found=1}else{found=0}}
         /address/{if(found){address=$NF}}
         /netmask/{if(found){netmask=$NF}}
         /broadcast/{if(found){broadcast=$NF}}
         /gateway/{if(found){gateway=$NF}}
         /dns-nameservers/{if(found){dnsnameservers=$NF}}
         END{print address" "netmask" "broadcast" "gateway" 
"dnsnameservers}' /etc/network/interfaces >"$TMP"

Regards,
Marek
-- 

*Marek Malevič*
www.malevic.cz <http://www.malevic.cz>
+420 608 116 896
History
Date User Action Args
2011-12-08 13:45:57mikasetstatus: fixed-in-git -> resolved
nosy: mika, info10
messages: + msg4100
2011-12-08 12:55:40mikasetassignedto: mika
nosy: + mika
2011-12-08 12:55:35mikasetstatus: chatting -> fixed-in-git
2011-12-08 12:55:31mikasetpriority: bug
status: unread -> chatting
messages: + msg4099
2011-12-02 12:02:49info10create