From ee5092971ec8ce233f656445b81bde75e1fa9a3d Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Tue, 31 Mar 2026 15:57:58 +0900 Subject: [PATCH] tests: dd: check that erroneous seeks are not done in output * tests/dd/misc.sh: Add test case for of=/dev/tty. The same occurs for /dev/stdout, but that varies in the test hardness so is best avoided. https://github.com/coreutils/coreutils/pull/234 --- tests/dd/misc.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/dd/misc.sh b/tests/dd/misc.sh index ad13d2208..e6559bf16 100755 --- a/tests/dd/misc.sh +++ b/tests/dd/misc.sh @@ -124,4 +124,10 @@ dd if=$tmp_in of=$tmp_out count=00x$big status=noxfer 2>err || fail=1 compare /dev/null $tmp_out || fail=1 compare err_ok err || fail=1 +# Ensure of=/dev/tty is possible +if test -c /dev/tty && test -w /dev/tty; then + dd if=/dev/null of=/dev/tty || fail=1 +fi + + Exit $fail