]> git.ipfire.org Git - thirdparty/bind9.git/commit
Only use LC_ALL=C where intended
authorMichał Kępień <michal@isc.org>
Tue, 10 Dec 2019 09:31:33 +0000 (10:31 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 10 Dec 2019 10:57:57 +0000 (11:57 +0100)
commit7c14f67d7480d013344e5a2b474ec036766e83d4
treeda7e40736f4c6204234306aacc1ecc871f7e4e06
parent18d314fa64e6963f76c6d2b552c58e0cbe5a280c
Only use LC_ALL=C where intended

The LC_ALL=C assignments in the "idna" system test, which were only
meant to affect a certain subset of checks, in fact persist throughout
all the subsequent checks in that system test.  That affects the test's
behavior and is misleading.

When the "VARIABLE=value command ..." syntax is used in a shell script,
in order for the variable assignment to only apply to "command", the
latter must be an external binary; otherwise, the VARIABLE=value
assignment persists for all subsequent commands in a script:

    $ cat foo.sh
    #!/bin/sh

    foo() {
        /bin/sh bar.sh
    }

    BAR="baz0"
    BAR="baz1" /bin/sh bar.sh
    echo "foo: BAR=${BAR}"
    BAR="baz2" foo
    echo "foo: BAR=${BAR}"

    $ cat bar.sh
    #!/bin/sh

    echo "bar: BAR=${BAR}"

    $ /bin/sh foo.sh
    bar: BAR=baz1
    foo: BAR=baz0
    bar: BAR=baz2
    foo: BAR=baz2
    $

Fix by saving the value of LC_ALL before the relevant set of checks in
the "idna" system test, restoring it afterwards, and dropping the
"LC_ALL=C command ..." syntax.

(cherry picked from commit 2ee7ff23ce9c3ff6c920b68b5f25682d1e76e5e7)
bin/tests/system/idna/tests.sh