Skip to content

ln: accept non-utf8 source names in target-dir modes#11403

Open
can1357 wants to merge 3 commits intouutils:mainfrom
can1357:ln-accept-non-utf8-source-names-in-target-dir-modes
Open

ln: accept non-utf8 source names in target-dir modes#11403
can1357 wants to merge 3 commits intouutils:mainfrom
can1357:ln-accept-non-utf8-source-names-in-target-dir-modes

Conversation

@can1357
Copy link
Copy Markdown
Contributor

@can1357 can1357 commented Mar 18, 2026

When given target-directory forms like ln SOURCE... DIRECTORY, uutils ln rejects source paths with non-UTF-8 filename bytes, while GNU ln accepts them and creates the link in the destination directory.

Reproduction Steps

name=$(printf 'bad_\377'); mkdir dst; : > "$name"; ln "$name" dst
# Expected (GNU): exit 0, creates dst/bad_\377
# Actual (uutils): exit 1 with "cannot stat $'bad_\xFF'", dst remains empty

Impact

GNU compatibility is broken for byte-oriented filenames on Unix filesystems.

@xtqqczze
Copy link
Copy Markdown
Contributor

Nice! I guess we can also remove unused ln-error-cannot-stat strings.

sylvestre added a commit to sylvestre/coreutils-1 that referenced this pull request Apr 3, 2026
* tests/ln/non-utf8-src.sh: New test ensuring ln handles source
filenames containing non-UTF-8 bytes when linking into a target
directory, for both hard links and symbolic links with -t.
* tests/local.mk: Register the new test.
uutils/coreutils#11403
gitmirroring-auto-sync-bot Bot pushed a commit to GitMirroring/coreutils that referenced this pull request Apr 6, 2026
* tests/ln/non-utf8-src.sh: New test ensuring ln handles source
filenames containing non-UTF-8 bytes when linking into a target
directory, for both hard links and symbolic links with -t.
* tests/local.mk: Register the new test.
uutils/coreutils#11403
coreutils/coreutils#240
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants