#909789 manpages-dev: stat(2) manpage on ENOENT for dangling symbolic links (broken links)

Package:
manpages-dev
Source:
manpages
Submitter:
Alessandro Vesely
Date:
2022-01-26 19:03:07 UTC
Severity:
minor
Tags:
#909789#5
Date:
2018-09-28 11:38:59 UTC
From:
To:
Dear Maintainer,

it seems to be a gotcha having stat(x, y) unexpectedly return -1 when x is a
broken link.  The stat(1) command works where stat(2) fails.  The obvious
solution is to use lstat.

It is difficult to fix this without ineffectually lengthening the text.
Perhaps, using the concept of unlinked file, which is valid for hard and soft
links alike, might help.  For example, the man page says:

ENOENT A component of pathname does not exist, or pathname is an empty string.

Alternatively, it could say:

ENOENT A component of pathname is unlinked (does not exist), or pathname is an
empty string.



Besides, the 1st paragraph in the NOTES section says "AT_NO_AUTOMOUNT fag".
Please substitute "AT_NO_AUTOMOUNT flag" lest someone smokes their unmounted
devices...



Thanks for maintaining man pages
Ale

#909789#10
Date:
2018-09-28 20:14:21 UTC
From:
To:
tags fixed-upstream
thanks

Hello Ale,

Upstream maintainer here...

Thanks for your report!

It's not merely a question of a broken symlink in the final pathname
component, which lstat() could address. ENOENT can also occur if any
component in the pathname is a dangling symbolic link. So I changed the
ENOENT text to:

        ENOENT A  component  of  pathname  does not exist or is a
               dangling symbolic link.

        ENOENT pathname is an empty string and AT_EMPTY_PATH  was
               not specified in flags.

:-)

In fact, that text was fixed about a year ago, so you don't have quite
the most up-to-date pages :-).

You are welcome!

Cheers,

Michael

#909789#15
Date:
2018-09-28 20:14:21 UTC
From:
To:
tags fixed-upstream
thanks

Hello Ale,

Upstream maintainer here...

Thanks for your report!

It's not merely a question of a broken symlink in the final pathname
component, which lstat() could address. ENOENT can also occur if any
component in the pathname is a dangling symbolic link. So I changed the
ENOENT text to:

        ENOENT A  component  of  pathname  does not exist or is a
               dangling symbolic link.

        ENOENT pathname is an empty string and AT_EMPTY_PATH  was
               not specified in flags.

:-)

In fact, that text was fixed about a year ago, so you don't have quite
the most up-to-date pages :-).

You are welcome!

Cheers,

Michael

#909789#20
Date:
2020-11-06 11:43:10 UTC
From:
To:
tags 909789 fixed-upstream
thanks

#909789#25
Date:
2020-11-06 11:43:10 UTC
From:
To:
tags 909789 fixed-upstream
thanks

#909789#32
Date:
2022-01-26 19:02:39 UTC
From:
To:
Confirmed to be present in man-pages-5.00 (first packaged in Debian in
5.01-1), hence this bug could be closed accordingly.

Also confirmed to be fixed.

Cheers,
Flo