install with piped input fails if target file exists
Open
Nobody has claimed this yet.
U - install
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
Reproduction steps
$ echo foo | install /dev/stdin bar
$ echo foo | install /dev/stdin bar
install: No such file or directory
Expected behaviour
Piped content is written to target file as per coreutils behaviour, regardless of whether target file exists.
Actual behaviour
Error message printed about missing file only if target file already exists.
From an strace it looks like it trips up chasing symlinks for the stdin pipe:
readlink("/proc", 0x7ffe5f48f540, 1023) = -1 EINVAL (Invalid argument)
readlink("/proc/self", "328710", 1023) = 6
readlink("/proc/328710", 0x7ffe5f48f540, 1023) = -1 EINVAL (Invalid argument)
readlink("/proc/328710/fd", 0x7ffe5f48f540, 1023) = -1 EINVAL (Invalid argument)
readlink("/proc/328710/fd/0", "pipe:[2063159]", 1023) = 14
readlink("/proc/328710/fd/pipe:[2063159]", 0x7ffe5f48f540, 1023) = -1 ENOENT (No such file or directory)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two install /dev/stdin bar commands from the issue and trace the install command's handling of piped stdin when bar already exists. Compare the behavior with the first run and GNU coreutils, then verify that piped content is written to the existing target without the missing-file error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100