Skip to content

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

@HackingRepo

Description

@HackingRepo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions