From 566aeee28126356d33022cfe89aa6ea006713784 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 29 Oct 2026 21:30:39 +0100 Subject: [PATCH] tests: realpath: ensure realpath -s -e fails on a dangling symlink Reported at https://github.com/uutils/coreutils/issues/15996 * tests/misc/realpath.sh: Add test case. Link: https://github.com/coreutils/coreutils/pull/432 --- tests/misc/realpath.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/misc/realpath.sh b/tests/misc/realpath.sh index 3ef5f9b39..c54fc2859 100755 --- a/tests/misc/realpath.sh +++ b/tests/misc/realpath.sh @@ -156,4 +156,9 @@ realpath -ms loop >out 2>err || fail=1 compare exp out || fail=1 compare /dev/null err || fail=1 +# -e must check existence even when not resolving symlinks. +ln -s missing dangling || framework_failure_ +returns_ 1 realpath --no-symlinks -e dangling > out 2> err || fail=1 +compare /dev/null out || fail=1 + Exit $fail