bug#72756: Potential Bug/Vuln in test.c

2024-08-22 Thread Thomas Wolff
Am 22.08.2024 um 08:54 schrieb Philip Rowlands: On Wed, 21 Aug 2024, at 18:29, Nathan Hays via GNU coreutils Bug Reports wrote: Test: ~~~bash testvar='' [ -n $testvar ] echo -n unquote exit $? [ -n "$testvar" ] echo -n quote exit $? [ -z $testvar ] echo -z unquote exit $? [ -z "$testvar" ] ech

bug#72756: Potential Bug/Vuln in test.c

2024-08-21 Thread Philip Rowlands
On Wed, 21 Aug 2024, at 18:29, Nathan Hays via GNU coreutils Bug Reports wrote: > Test: > ~~~bash > testvar='' > [ -n $testvar ] > echo -n unquote exit $? > [ -n "$testvar" ] > echo -n quote exit $? > [ -z $testvar ] > echo -z unquote exit $? > [ -z "$testvar" ] > echo -z quote exit $? > ~~~ For t

bug#72756: Potential Bug/Vuln in test.c

2024-08-21 Thread Paul Eggert
I don't see a bug there. 'test' is behaving as documented. Expectation: `var=''; [ -n $var ]; echo $?` should NOT return `0` This expectation is incorrect, because that command should exit with status 0. This is because the command '[ -n $var ]' is equivalent to: [ -n ] which is equivale

bug#72756: Potential Bug/Vuln in test.c

2024-08-21 Thread Nathan Hays via GNU coreutils Bug Reports
# ENV # Ubuntu 22.04 LTS COREUTILS version 8.32-4.1ubuntu1.2 *Note could be specific to Ubuntu but I believe I confirmed in source* # Observed Behavior # Expectation: `var=''; [ -n $var ]; echo $?` should NOT return `0` Reality: `var=''; [ -n $var ]; echo $?` returns `0` *Note that this behav