uutils / uutils/coreutils

install with piped input fails if target file exists

Open
#12,407 0 comments 1 reaction 0 assignees View on GitHub

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.