BTS

Issue843

Title grml-network issues (bashisms/dependency)
Priority bug Status resolved
Superseder Nosy List jkirk, mika
Assigned To mika Topics

Created on 2010-04-19.10:05:19 by jkirk, last changed 2010-04-28.23:01:16 by mika.

Files
File name Uploaded Type Edit Remove
0001-Fixed-bashisms-found-with-checkbashisms.patch jkirk, 2010-04-19.10:05:17 text/x-diff
0002-Added-iptables-dependency.patch jkirk, 2010-04-19.10:05:17 text/x-diff
0003-Fixed-testing-for-root.patch jkirk, 2010-04-19.10:18:08 text/x-diff
Messages
msg3162 (view) Author: mika Date: 2010-04-28.23:01:15
We believe that your issue has been closed by the upload of
Version 0.3.3 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, 29 Apr 2010 00:42:05 +0200
Source: grml-network
Binary: grml-network
Architecture: source all
Version: 0.3.3
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.3.3) unstable; urgency=low
 .
   * Add iptables to Recommends.
   * Fix bashism/non-POSIX usage of $UID.
     [Closes: issue843] Thanks to Darshaka Pathirana.
Checksums-Sha1: 
 7932d565bfe01db6fb3bf10b8c4bba43a2571772 888 grml-network_0.3.3.dsc
 75d5e412d5ceaaacd4503d609153d5d290dc1c19 89172 grml-network_0.3.3.tar.gz
 0dc70efd76a7ae9575a9562e3831b85366dcc4f5 99400 grml-network_0.3.3_all.deb
Checksums-Sha256: 
 18f7888ae381567909a45c2266e301c1951460847c5cb26d14c8b5761060474e 888 grml-network_0.3.3.dsc
 1012410546b3802d1fedda557a98d1b4593d60221eeeba2d8fc274104d1f9814 89172 grml-network_0.3.3.tar.gz
 d81be7c681dd5074c2f7ddb6d8050ac292cc4a75ce70f15b9cbac7040c1f1472 99400 grml-network_0.3.3_all.deb
Files: 
 083f91a135179be7713a0614bf07f56a 888 grml optional grml-network_0.3.3.dsc
 2a0b1a0079ed21889d6368d5ab05b5c6 89172 grml optional grml-network_0.3.3.tar.gz
 c4f1ea054f8e60f842976a4dffba6ab4 99400 grml optional grml-network_0.3.3_all.deb

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

iD8DBQFL2Ltq2N9T+zficugRAh2gAJ0R+C+4rIm7V9znXPOI3E9atFrYrQCbBJQV
mjjKQ1qeupn01MVuhifeavw=
=l/du
-----END PGP SIGNATURE-----
msg3161 (view) Author: mika Date: 2010-04-28.22:47:52
Thanks for your patches, Darsha. I didn't apply them as they are but decided to 
slightly adjust them:

* iptables shouldn't be a dependency but just a Recommends (it's not a strict 
dependency for all the scripts of grml-network)

* [ "$(id -ru)" -ne "0" ] isn't a string match, it would have to be != - but in 
agreement with Frank (our shell specialist) we decided to use "[ $(id -ru) -ne 
0 ]" instead

Fixed in git - upload will happen soon, thanks for your feedback and patches!

regards,
-mika-
msg3148 (view) Author: jkirk Date: 2010-04-19.10:18:08
Hi!

According to [1] "string comparison is better in shell as argument
lists are strings" to test for root:

[1] http://dabase.com/e/13022/

I've attached a patch (depending on my previous one) to fix this.

Greetings,
 - Darsha
msg3147 (view) Author: jkirk Date: 2010-04-19.10:05:17
Package: grml-network
Version: 0.3.2
Severity: normal
Tags: patch

Hi!

grml-router fails when running in Ubuntu 9.10:

# grml-router
[: 17: !=: unexpected operator
/sbin/iptables not installed

So shouldn't grml-network depend on iptables (or at least recommend
it)?

I then cloned the git-repository and did:

% checkbashisms grml-network/sbin/*
script grml-network/sbin/grml-network is already a bash script; skipping
possible bashism in grml-network/sbin/grml-pptp-inode line 17 ($UID should be "$(id -ru)"):
if [ $UID != 0 ] ; then
possible bashism in grml-network/sbin/grml-pptp-inode line 49 (echo -e):
echo -e "#!/bin/sh\nLANG=C\nVPNSERVER=\"${VPNSERVER}\"\n" > /etc/init.d/pptp
script grml-network/sbin/grml-pptp-vcgraz does not appear to be a /bin/sh script; skipping
possible bashism in grml-network/sbin/grml-pptp-xdsl-students line 20 ($UID should be "$(id -ru)"):
if [ "$UID" != 0 ];  then
possible bashism in grml-network/sbin/grml-pptp-xdsl-students line 67 (echo -e):
echo -e "#!/bin/sh\nLANG=C\nVPNSERVER=\"${VPNSERVER}\"\n" > /etc/init.d/pptp
possible bashism in grml-network/sbin/grml-router line 14 ($UID should be "$(id -ru)"):
if [ $UID != 0 ]; then
script grml-network/sbin/grml-vnet is already a bash script; skipping
script grml-network/sbin/grml-vpnc-tugraz is already a bash script; skipping
script grml-network/sbin/modemlink is already a bash script; skipping
script grml-network/sbin/netcardconfig is already a bash script; skipping
script grml-network/sbin/scanmodem is already a bash script; skipping

I've attached some patches.

Greetings,
 - Darsha

-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 'karmic')
Architecture: i386 (i686)

Kernel: Linux 2.6.31-20-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages grml-network depends on:
ii  dialog                   1.1-20080819-1  Displays user-friendly dialog boxe
ii  grml-etc-core            0.3.60          core ecetera files for the grml sy
ii  psmisc                   22.7-1          utilities that use the proc file s
ii  zsh                      4.3.10-5ubuntu1 A shell with lots of features

Versions of packages grml-network recommends:
ii  bridge-utils         1.4-5               Utilities for configuring the Linu
ii  nmap                 5.00-2              The Network Mapper
ii  pppoeconf            1.18ubuntu1         configures PPPoE/ADSL connections
ii  pptp-linux           1.7.2-3             Point-to-Point Tunneling Protocol 
ii  resolvconf           1.44ubuntu1         name server information handler
ii  uml-utilities        20070815-1.1ubuntu2 User-mode Linux (utility programs)
ii  vpnc                 0.5.3-1             Cisco-compatible VPN client
ii  wireless-tools       29-2ubuntu6         Tools for manipulating Linux Wirel
ii  wpasupplicant        0.6.9-3ubuntu1      client support for WPA and WPA2 (I
ii  wvdial               1.60.1+nmu2ubuntu1  PPP dialer with built-in intellige

Versions of packages grml-network suggests:
pn  isdnutils-base                <none>     (no description available)

-- no debconf information
History
Date User Action Args
2010-04-28 23:01:16mikasetstatus: fixed-in-git -> resolved
nosy: mika, jkirk
messages: + msg3162
2010-04-28 22:47:53mikasetstatus: chatting -> fixed-in-git
nosy: mika, jkirk
messages: + msg3161
2010-04-26 22:36:06mikasetpriority: bug
assignedto: mika
nosy: + mika
2010-04-19 10:18:08jkirksetfiles: + 0003-Fixed-testing-for-root.patch
status: unread -> chatting
messages: + msg3148
2010-04-19 10:05:19jkirkcreate