uutils / uutils/coreutils

coreutils: Resolve symlink with invalid binary name for better dummy support

Open
#10,946 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

People might symlink /usr/bin/{true/false,etc...} to other binaries as dummy. It works with individual binaries, but it does not work with argv[0] based multi-call binary.
We can readlink if coreutils was called with invalid name from absolute path. But it does not work if it was called from PATH.
At Linux, getauxval (AT_EXECFN) & readlink can be used for the usacase. I don't know what can we use on other platforms.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how coreutils handles argv[0] for invalid names, especially when invoked through PATH rather than an absolute path. Review the Linux getauxval(AT_EXECFN) and readlink approach, then investigate equivalent behavior on supported platforms. Done means symlinked dummy commands resolve correctly for both invocation forms without regressing normal multicall behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.