From: Sylvestre Ledru Date: Fri, 10 Oct 2025 11:38:33 +0000 (+0200) Subject: tests: ln -f: ensure existing link replaced X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae0fcbba97a46dee1b5369ca5696e2737642410f;p=thirdparty%2Fcoreutils.git tests: ln -f: ensure existing link replaced Identified here: * tests/ln/misc.sh: Add the check. --- diff --git a/tests/ln/misc.sh b/tests/ln/misc.sh index bae731ef44..79ea5abe59 100755 --- a/tests/ln/misc.sh +++ b/tests/ln/misc.sh @@ -96,6 +96,14 @@ ln --no-dereference -fs "$af" $ld || fail=1 test -f $ld || fail=1 rm -rf $d $f $ld +# -f on a existing file should not generate an error +rm -rf $d $f +touch $f || framework_failure_ +mkdir $d || framework_failure_ +ln $f $d +ln -f $f $d || fail=1 +test -d $d || fail=1 + # Try to create a symlink with backup where the destination file exists # and the backup file name is a hard link to the destination file. touch a b || framework_failure_