-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Component
touch
Description
When touch is asked to follow symlinks (default), stat() falls back from fs::metadata() to
fs::symlink_metadata() on any error.
fs::metadata(path).or_else(|_| fs::symlink_metadata(path))This means touch -r <ref> <dst> will silently accept a dangling symlink reference and use the symlink’s
own timestamps, instead of erroring like GNU.
Test / Reproduction Steps
mkdir -p /tmp/touch-audit
cd /tmp/touch-audit
ln -s /nope ref
rm -f out
# uutils: succeeds, creates "out"
# GNU: fails (reference is inaccessible)
touch -r ref out; echo "exit:$?"; ls -la outImpact
Hides real failures for -r/--reference and can make scripts behave as if the reference file was valid.
Also breaks GNU compatibility.
Reactions are currently unavailable