uutils / uutils/coreutils

minorbug(pwd): when the current cwd swapped to be a normal file it returns vague error messages

Open
#12,967 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi, uutils mainteners

that issue to be triggered you need 2 terminals,

in the 1st terminal the first step is

$ mkdir z
$ cd z

then create a new terminal and

$ pwd

to verify in my case showed me /home/relunsec/software/coreutils/target/debug/z

then go back to the first terminal and then type the following commands

relunsec@relunsec:~/software/coreutils/target/debug$ rm -rf z
relunsec@relunsec:~/software/coreutils/target/debug$ touch z

back to the second terminal and then type ./pwd again as i see the error too vague

relunsec@relunsec:~/software/coreutils/target/debug/z$ ../pwd
pwd: failed to get current directory: No such file or directory

currently z is a file but not a directory after swapped in the terminal one, so that is a wrong message, now try with gnu one

relunsec@relunsec:~/software/coreutils/target/debug/z$ gnupwd
gnupwd: couldn't find directory entry in ‘..’ with matching i-node
relunsec@relunsec:~/software/coreutils/target/debug/z$ 

correct that is the correct error and clear error message

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

Reproduce the two-terminal scenario described in the issue with the Rust pwd command, then locate its current-directory error handling from the pwd entry point. Compare the resulting message with GNU pwd and consider the work complete when the swapped-directory case reports a specific, clear error and the relevant tests pass.

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
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.