Debian Bug report logs - #623356
be more careful with subshells

version graph

Package: live-build; Maintainer for live-build is Live Systems Maintainers <debian-live@lists.debian.org>; Source for live-build is src:live-build.

Reported by: liandrosg <liandrosg@gmail.com>

Date: Tue, 19 Apr 2011 15:42:01 UTC

Severity: normal

Found in version live-build/3.0~a11-1

Fixed in version live-build/3.0~a17-1

Done: Daniel Baumann <daniel@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#623356; Package live-build. (Tue, 19 Apr 2011 15:42:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to liandrosg <liandrosg@gmail.com>:
New Bug report received and forwarded. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Tue, 19 Apr 2011 15:42:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: liandrosg <liandrosg@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: live-build: be more careful with subshells
Date: Tue, 19 Apr 2011 11:38:58 -0300
Package: live-build
Version: 3.0~a11-1
Severity: normal

In bash, and dash, the Grouping Commands builtin structure commands are "(list)" or "{list;}"
The first of these executes the commands in a subshell.  The second form
  does not fork another shell so is slightly more efficient.
Simple verification of command exit status in scripts:
The follow expressions is wrong, because exits from a subshell, no from current shell:
  command || (echo "error" ; exit 1)
The correct form is:
  command || {echo "error" ; exit 1;}

--- /scripts/build/lb_binary_local-hooks.old    2011-04-19 10:16:53.290043819 -0300
+++ /scripts/build/lb_binary_local-hooks        2011-04-19 10:17:49.098793548 -0300
@@ -50,7 +50,7 @@
                fi

                # Executing hook
-               ./"${HOOK}" || ( Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 )
+               ./"${HOOK}" || { Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
        done

        # Creating stage file


--- /scripts/build/lb_chroot_hooks.old  2011-04-19 10:32:18.348793894 -0300
+++ /scripts/build/lb_chroot_hooks      2011-04-19 10:32:33.898792823 -0300
@@ -55,7 +55,7 @@
                fi

                # Executing hook
-               Chroot chroot "./root/${HOOK}" || ( Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 )
+               Chroot chroot "./root/${HOOK}" || { Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}

                # Removing hook
                rm -f chroot/root/"${HOOK}"


--- /scripts/build/lb_chroot_local-hooks.old    2011-04-19 10:34:58.940043769 -0300
+++ /scripts/build/lb_chroot_local-hooks        2011-04-19 10:35:08.789160375 -0300
@@ -56,7 +56,7 @@
                fi

                # Executing hook
-               Chroot chroot "/root/$(basename ${HOOK})" || ( Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 )
+               Chroot chroot "/root/$(basename ${HOOK})" || { Echo_error "${HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}

                # Removing hook
                rm -f chroot/root/"$(basename ${HOOK})"


-- Package-specific info:

-- System Information:
Debian Release: squeeze/sid
  APT prefers lucid-updates
  APT policy: (500, 'lucid-updates'), (500, 'lucid')
Architecture: amd64 (x86_64)

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

Versions of packages live-build depends on:
ii  debootstrap              1.0.20ubuntu1.2 Bootstrap a basic Debian system

Versions of packages live-build recommends:
ii  cpio                       2.10-1ubuntu2 GNU cpio -- a program to manage ar
ii  gettext-base               0.17-8ubuntu3 GNU Internationalization utilities
pn  gnu-fdisk                  <none>        (no description available)

Versions of packages live-build suggests:
ii  dosfstools       3.0.7-1                 utilities for making and checking 
ii  fakeroot         1.14.4-1ubuntu1         Gives a fake root environment
ii  genisoimage      9:1.1.10-1ubuntu1       Creates ISO-9660 CD-ROM filesystem
ii  memtest86+       4.00-2ubuntu3           thorough real-mode memory tester
ii  mtools           4.0.10-1ubuntu1         Tools for manipulating MSDOS files
ii  parted           2.2-5ubuntu5.1          The GNU Parted disk partition resi
pn  squashfs-tools | <none>                  (no description available)
ii  sudo             1.7.2p1-1ubuntu5.3      Provide limited super user privile
ii  syslinux         2:3.63+dfsg-2ubuntu3    Bootloader for Linux/i386 using MS
ii  uuid-runtime     2.17.2-0ubuntu1.10.04.2 runtime components for the Univers
pn  win32-loader     <none>                  (no description available)

-- no debconf information




Changed Bug title to 'be more careful with subshells' from 'live-build: be more careful with subshells' Request was from Daniel Baumann <daniel.baumann@progress-technologies.net> to control@bugs.debian.org. (Wed, 20 Apr 2011 11:18:02 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#623356; Package live-build. (Wed, 20 Apr 2011 11:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to daniel.baumann@progress-technologies.net:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Wed, 20 Apr 2011 11:27:08 GMT) Full text and rfc822 format available.

Message #12 received at 623356@bugs.debian.org (full text, mbox):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: liandrosg <liandrosg@gmail.com>
Cc: 623356@bugs.debian.org
Subject: Re: Bug#623356: live-build: be more careful with subshells
Date: Wed, 20 Apr 2011 13:15:11 +0200
retitle 623356 be more careful with subshells
thanks

On 04/19/2011 04:38 PM, liandrosg wrote:
> In bash, and dash, the Grouping Commands builtin structure commands are "(list)" or "{list;}"
> The first of these executes the commands in a subshell.  The second form
>   does not fork another shell so is slightly more efficient.

{} as grouping is not posix compatible, therefore it should not be used
in live-build. do you know a posix-compliant way of fixing it?

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#623356; Package live-build. (Wed, 20 Apr 2011 11:48:33 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Wed, 20 Apr 2011 11:48:48 GMT) Full text and rfc822 format available.

Message #17 received at 623356@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: 623356@bugs.debian.org
Cc: liandrosg <liandrosg@gmail.com>
Subject: Re: live-build: be more careful with subshells
Date: Wed, 20 Apr 2011 06:45:54 -0500
Hi,

Daniel Baumann wrote:

> {} as grouping is not posix compatible, therefore it should not be used
> in live-build. do you know a posix-compliant way of fixing it?

{ and } are in POSIX.  See XCU 2.9.4.1 "Grouping Commands" at
<http://unix.org/2008edition/>:

 { compound-list;}

	Execute compound-list in the current process environment. The
	semicolon shown here is an example of a control operator
	delimiting the } reserved word.  Other delimiters are
	possible, as shown in Section 2.10 (on page 2325); a <newline>
	is frequently used.

Hope that helps,
Jonathan




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#623356; Package live-build. (Sat, 23 Apr 2011 12:36:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to daniel.baumann@progress-technologies.net:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Sat, 23 Apr 2011 12:36:03 GMT) Full text and rfc822 format available.

Message #22 received at 623356@bugs.debian.org (full text, mbox):

From: Daniel Baumann <daniel.baumann@progress-technologies.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: 623356@bugs.debian.org
Subject: Re: Bug#623356: live-build: be more careful with subshells
Date: Sat, 23 Apr 2011 14:31:58 +0200
On 04/20/2011 01:45 PM, Jonathan Nieder wrote:
> { and } are in POSIX.  See XCU 2.9.4.1 "Grouping Commands" at
> <http://unix.org/2008edition/>:

so posh (and other shells) needs to be updated then.

-- 
Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
Email:          daniel.baumann@progress-technologies.net
Internet:       http://people.progress-technologies.net/~daniel.baumann/




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Live Project <debian-live@lists.debian.org>:
Bug#623356; Package live-build. (Sat, 23 Apr 2011 12:48:13 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Live Project <debian-live@lists.debian.org>. (Sat, 23 Apr 2011 12:48:14 GMT) Full text and rfc822 format available.

Message #27 received at 623356@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Daniel Baumann <daniel.baumann@progress-technologies.net>
Cc: 623356@bugs.debian.org
Subject: Re: live-build: be more careful with subshells
Date: Sat, 23 Apr 2011 07:44:27 -0500
Daniel Baumann wrote:
> On 04/20/2011 01:45 PM, Jonathan Nieder wrote:

>> { and } are in POSIX.  See XCU 2.9.4.1 "Grouping Commands" at
>> <http://unix.org/2008edition/>:
>
> so posh (and other shells) needs to be updated then.

Hmm...

| $ posh -c '{ echo hi;}'
| hi
| $ echo $?
| 0
| $ dpkg-query -W posh
| posh	0.10

What am I doing wrong?




Reply sent to Daniel Baumann <daniel@debian.org>:
You have taken responsibility. (Wed, 18 May 2011 18:21:08 GMT) Full text and rfc822 format available.

Notification sent to liandrosg <liandrosg@gmail.com>:
Bug acknowledged by developer. (Wed, 18 May 2011 18:21:08 GMT) Full text and rfc822 format available.

Message #32 received at 623356-close@bugs.debian.org (full text, mbox):

From: Daniel Baumann <daniel@debian.org>
To: 623356-close@bugs.debian.org
Subject: Bug#623356: fixed in live-build 3.0~a17-1
Date: Wed, 18 May 2011 18:17:42 +0000
Source: live-build
Source-Version: 3.0~a17-1

We believe that the bug you reported is fixed in the latest version of
live-build, which is due to be installed in the Debian FTP archive:

live-build-cgi_3.0~a17-1_all.deb
  to main/l/live-build/live-build-cgi_3.0~a17-1_all.deb
live-build_3.0~a17-1.debian.tar.gz
  to main/l/live-build/live-build_3.0~a17-1.debian.tar.gz
live-build_3.0~a17-1.dsc
  to main/l/live-build/live-build_3.0~a17-1.dsc
live-build_3.0~a17-1_all.deb
  to main/l/live-build/live-build_3.0~a17-1_all.deb
live-build_3.0~a17.orig.tar.gz
  to main/l/live-build/live-build_3.0~a17.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 623356@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Baumann <daniel@debian.org> (supplier of updated live-build package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


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

Format: 1.8
Date: Wed, 18 May 2011 19:49:53 +0200
Source: live-build
Binary: live-build live-build-cgi
Architecture: source all
Version: 3.0~a17-1
Distribution: unstable
Urgency: low
Maintainer: Debian Live Project <debian-live@lists.debian.org>
Changed-By: Daniel Baumann <daniel@debian.org>
Description: 
 live-build - Debian Live - System Build Scripts
 live-build-cgi - Debian Live - System Build Scripts (cgi frontend)
Closes: 623356 626367 626905 626940
Changes: 
 live-build (3.0~a17-1) unstable; urgency=low
 .
   [ Daniel Baumann ]
   * Updating squeeze point release number.
   * Updating ubuntu releases.
   * Enabling xz compression by default for artax-backports.
   * Updating url for debian-installer daily-images.
 .
   [ Ben Armstrong ]
   * Using gdm3 for wheezy instead of gdm.
 .
   [ Daniel Baumann ]
   * Don't add security repository for wheezy.
   * Avoid wrong security mirrors when building for artax-backports.
   * Correct derivative main sources.list entries.
   * Correcting wrongly attributed -m switch to --mirror-bootstrap,
     thanks to Colin Watson <cjwatson@ubuntu.com> (Closes: #626905).
   * Correcting comments about which ubuntu release is LTS and which not
     in releases list.
   * Removing defaults for the alpha architecture, not supported by
     debian anymore.
 .
   [ Colin Watson ]
   * Allow installing tasks using apt-get, and do so by default for
     Ubuntu (Closes: #626940).
 .
   [ Daniel Baumann ]
   * Switching to apt as tasksel for all distributions, except Debian
     squeeze.
   * Updating to standards version 3.9.2.
   * Completing files section in live-build manpage (Closes: #626367).
   * Correcting top-level makefile to automatically get all the supported
     languages, rather than defining a static list.
 .
   [ liandro sg ]
   * Be more careful with subshells (Closes: #623356).
Checksums-Sha1: 
 ee45f7b79603206e5744df3a7bf6c3bd71646b17 1282 live-build_3.0~a17-1.dsc
 0392c689a61cbf932bd67faf0213512d25df975a 1944214 live-build_3.0~a17.orig.tar.gz
 87f662cdf151e7fc01d98a5a2bc218def45d4d52 40605 live-build_3.0~a17-1.debian.tar.gz
 44a656f090907b2c11f2434a2b9ea88ea9b9f30d 1176488 live-build_3.0~a17-1_all.deb
 c3047616a07d218e52328612165867e8789b8454 56786 live-build-cgi_3.0~a17-1_all.deb
Checksums-Sha256: 
 e196e0e5bc3783824be0539ad505a5fa08daa73524d48ceb80b2dac3880e64a0 1282 live-build_3.0~a17-1.dsc
 e64b6aa9b9d9f7f543f5323df764adcb4e15df3a73988153bb5d43315510d77c 1944214 live-build_3.0~a17.orig.tar.gz
 5fb5062ca620b0d177b56885d7c51ac6ef28f75a95b33b0fc7ece51b2a1ffcfc 40605 live-build_3.0~a17-1.debian.tar.gz
 f4e83a0ec933abf081748bc6517eb16fb7184f947463d78328ab48e9f8712cc0 1176488 live-build_3.0~a17-1_all.deb
 0f9c47d178b30fd35264fb91f64a0ab5de7cbd526ca345502374561c7085b809 56786 live-build-cgi_3.0~a17-1_all.deb
Files: 
 a1942df815147dad7548df7c555da587 1282 misc optional live-build_3.0~a17-1.dsc
 fb3cf9000f93b4a98d688191437bea2b 1944214 misc optional live-build_3.0~a17.orig.tar.gz
 0b56c1427e8d8af7b7bbabcbebe373d8 40605 misc optional live-build_3.0~a17-1.debian.tar.gz
 b3baf253f5cbab76db0d00060d7fc3bf 1176488 misc optional live-build_3.0~a17-1_all.deb
 a0f5d053bcf05bd788a327d8ad3ba503 56786 misc optional live-build-cgi_3.0~a17-1_all.deb

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

iEYEARECAAYFAk3UCIQACgkQ+C5cwEsrK56udQCg4pn0fryC43dJ8DmuTIp05bhJ
LtYAn1uHrYAnDIcqcyUlBAETzXpB6GoY
=rf7f
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 26 Jun 2011 07:35:51 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 06:15:26 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.