Skip to content

Fix unprovoked symlink errors in directory_entry - #353

Draft
stm-ableton wants to merge 1 commit into
boostorg:developfrom
stm-ableton:fix-directory-entry-symlink-errors
Draft

Fix unprovoked symlink errors in directory_entry#353
stm-ableton wants to merge 1 commit into
boostorg:developfrom
stm-ableton:fix-directory-entry-symlink-errors

Conversation

@stm-ableton

Copy link
Copy Markdown

Closes #352.

Also adds tests exercising directory_entry.

Since
boostorg@d508d49,
a number of functions in directory_entry's public interface call
directory_entry::refresh_impl, which updates the cached file status
comprehensively. On POSIX systems, for example, both lstat and stat are
called for symlinks, and stat errors are reported to the caller. As a
result, e.g. checking the status of a symlink with symlink_status
produces an error if the symlink target is gone or if access to it is
denied. In v4, this also affects the constructor overload that takes an
error_code, i.e. constructing a directory_entry with a path to a broken
symlink produces an error.

Add a parameter to refresh_impl allowing to configure what the caller is
interested in, thus avoiding false positives.

A note on the tests: we are missing some error code assertions, notably
in the directory_entry_tests block that tests the missing file case and
after some of the non-symlink status accessor calls in the dangling
symlink block in directory_entry_symlink_tests. The reason is an
unrelated issue that causes these functions to not report error for
non-existing files when reading from the cache. Due to the structure of
the tests, this is the case for many of these calls, and in v4, this
would always be the case after construction, since the constructors
write to the cache. This issue should be addressed separately.
@stm-ableton
stm-ableton marked this pull request as draft August 3, 2026 09:53
@stm-ableton
stm-ableton marked this pull request as ready for review August 3, 2026 12:27
@Lastique

Lastique commented Aug 3, 2026

Copy link
Copy Markdown
Member

I'd like to let you know that there is a massive change to library headers coming soon, that will likely make PRs against headers non-applicable. You may want to hold off the work on this.

@stm-ableton
stm-ableton marked this pull request as draft August 3, 2026 14:59
@stm-ableton

Copy link
Copy Markdown
Author

@Lastique Thank you for the heads up. I've converted to draft for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

directory_entry reports errors for dangling symlinks when it shouldn't

2 participants