>From c7c0c8b65981ab2163269ac8869ac763dc9f15c2 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 26 Nov 2016 15:37:43 -0800 Subject: [PATCH 2/2] shuf: test input-closed bug Problem reported by Alex Ryan (Bug#25029). * tests/misc/shuf.sh: Test for shuffling with stdin closed. --- tests/misc/shuf.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/misc/shuf.sh b/tests/misc/shuf.sh index dcc7e82..2e6141b 100755 --- a/tests/misc/shuf.sh +++ b/tests/misc/shuf.sh @@ -166,4 +166,9 @@ printf "A\nB\nC\nD\nE\n" | shuf --rep -n0 > exp || framework_failure_ test \! -s exp || { fail=1; echo "--repeat,STDIN,-n0 produced bad output">&2 ; } +# shuf 8.25 mishandles input if stdin is closed, due to glibc bug#15589. +# See coreutils bug#25029. +shuf /dev/null <&- >out || fail=1 +compare /dev/null out || fail=1 + Exit $fail -- 2.9.3