/bin/sh hang in some circonstance

Stacy Harper contact at stacyharper.net
Mon Aug 30 11:15:40 UTC 2021


Hello there,

There is an issue with busybox 1.34.0 :

I detailed the issue here :

https://gitlab.alpinelinux.org/alpine/aports/-/issues/12960

But to recap :

Shell will hang on this simple script :

    test() {
        . /tmp/bb_test
    }

    echo "export TEST=foo" > /tmp/bb_test

    test 2>/dev/null

    echo "$TEST"

Run with :

sudo -u <me> -n "$PWD"/busybox sh -c "$PWD"/test

So the issue seems to occurs when :

- The script source another file
- The output is redirected
- In non-interactive mode

I already bisected git and it looks that the first commit that
got the issue is :

a1b0d3856d9a0419cb74bf4c87525265871b5868

ash: add process substitution in bash-compatibility mode


More information about the busybox mailing list