Skip to content

namei shows no information when invalid symlink is found #2

Closed
@TomOnTime

Description

@TomOnTime

namei is a great tool for debugging complex paths, especially when symbolic links are involved. However, if the symbolic link is invalid, namei shows no information instead of partial:

Example 1:

$ ln -s /usr/local/does/not/exist /tmp/space
$ ls -lad /tmp/space
lrwxrwxrwx 1 tlim eng 25 2012-01-29 11:03 /tmp/space -> /usr/local/does/not/exist
$ namei /tmp/space
namei: failed to stat: /tmp/space: No such file or directory

Desired output:

f: /tmp/space
d /
d tmp
l space -> /usr/local/does/not/exist
d /
d usr
does ERROR: No such file or directory.

This was discovered when debugging the following problem: "mkdir -p /the/dir/path" was giving a strange error: "Cannot create directory `/the/dir': File exists". The obvious debugging tool was namei, but "namei /the/dir/path" failed to start because /the/dir/path did not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions