util: if DataDir is a symbolic link, manually follow it#24267
util: if DataDir is a symbolic link, manually follow it#24267nymkappa wants to merge 1 commit intobitcoin:masterfrom
DataDir is a symbolic link, manually follow it#24267Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
| if (!fs::is_directory(path)) { | ||
| path = ""; | ||
| return path; | ||
| } |
There was a problem hiding this comment.
What scenarios these lines are required in?
There was a problem hiding this comment.
A symbolic link may exist but point to a non existing location. For example, if your symbolic link point to an external hard drive, but it is not mounted.
|
I've tested the following scenarios. I run
bitcoind: fs.cpp:39: fs::path fsbridge::AbsPathJoin(const fs::path&, const fs::path&): Assertion `base.is_absolute()' failed.
Aborted (core dumped)
|
DataDir is a symbolic link, manually follow it
If there are behavior changes comparing to pre-20744 variant, could describe them in the PR description? |
This is the only behavior change I've noticed from the previously mentioned scenario between master@04255073bbd2b8ea71ae8a9ff7433be499312758 (before #20744 was merged) and my pull request. It looks like even though
|
FWIW, #24266 preserves the pre-20744 behavior, and for a broken link |
Closing this PR as #24266 provides a better fix. Thank you for your time hebasto 👍🏻 |

Fixes #24257
Another related fix attempt can be found here #24266