[Pkg-zsh-devel] Bug#945425: zsh: should run all pipeline elements in subshell in sh mode

brian m. carlson sandals at crustytoothpaste.net
Sun Nov 24 17:02:22 GMT 2019


Package: zsh
Version: 5.7.1-1+b1
Severity: normal

POSIX mandates that all elements in a pipeline are run in subshells, but
permits extensions that run some or all of those elements in the main
shell environment instead.

zsh always runs the final element in a pipeline in the normal shell
environment, which breaks programs which expect to conform to POSIX.
For example, the Git testsuite fails in a variety of ways when zsh is
/bin/sh.

This behavior is fine as zsh, since in that case it's obvious that
extensions are being enabled, but when "emulate sh" is set, the final
element in a pipeline should also be run in a subshell for maximum
compatibility with POSIX.

As an example, the attached program should print "boo", "baz", and
"foo", in that order when run under "zsh --emulate sh", but does not:

----
% dash foo.sh
boo
baz
foo
% zsh --emulate sh foo.sh
boo
baz
baz
----

-- Package-specific info:

Packages which provide vendor completions:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version         Architecture Description
+++-==============-===============-============-===========================================================
ii  curl           7.66.0-1+b1     amd64        command line tool for transferring data with URL syntax
ii  docker-compose 1.25.0-1        all          Punctual, lightweight development environments using Docker
ii  docker.io      19.03.4+dfsg2-2 amd64        Linux container runtime
ii  pulseaudio     13.0-3          amd64        PulseAudio sound server
ii  systemd        243-8           amd64        system and service manager
ii  tmuxinator     1.1.2-1         all          Create and manage tmux sessions easily
ii  udev           243-8           amd64        /dev/ and hotplug management daemon
ii  vlc-bin        3.0.8-3         amd64        binaries from VLC

dpkg-query: no path found matching pattern /usr/share/zsh/vendor-functions/


-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.3.0-2-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages zsh depends on:
ii  libc6       2.29-3
ii  libcap2     1:2.27-1
ii  libtinfo6   6.1+20191019-1
ii  zsh-common  5.7.1-1

Versions of packages zsh recommends:
ii  libc6         2.29-3
ii  libncursesw6  6.1+20191019-1
ii  libpcre3      2:8.39-12+b1

Versions of packages zsh suggests:
pn  zsh-doc  <none>

-- no debconf information

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.sh
Type: application/x-sh
Size: 157 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-zsh-devel/attachments/20191124/ed11c2e7/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 868 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-zsh-devel/attachments/20191124/ed11c2e7/attachment.sig>


More information about the Pkg-zsh-devel mailing list