Skip to content

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

Open
can1357 wants to merge 1 commit 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 1 commit intouutils:mainfrom
can1357:ln-accept-non-utf8-source-names-in-target-dir-modes

Conversation

@can1357
Copy link
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
Contributor

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants