Skip to content

Walk up Symlink Chain - #3462

Merged
Alexays merged 1 commit into
Alexays:masterfrom
DomCristaldi:walk-symlink-chain
Jul 21, 2024
Merged

Alexays merged 1 commit into
Alexays:masterfrom
DomCristaldi:walk-symlink-chain

Conversation

@DomCristaldi

@DomCristaldi DomCristaldi commented Jul 21, 2024

Copy link
Copy Markdown
Contributor

"reload_style_on_change" would check if the target file is a symlink, but only resolves the first link. If the symlink is acutally a chain of symlinks, such as what happens with NixOS's mkOutOfStoreSymlink, we will not find the actual file style file.

Updated the symlink resolution logic to walk down the symlink chain until it finds a non-symlink. Also check against a the original filename (which may be a symlink) to guard against infinitely looping on a circular symlink chain.

"reload_style_on_change" would check if the target file is a symlink,
but only resolves the first link. If the symlink is acutally a chain of
symlink, such as what happens with NixOS's mkOutOfStoreSymlink, we will
not find the actual file style file.

Update the symlink resolution logic to walk down the symlink chain until
it finds a non-symlink. Also check against a the original filename
(which may be a symlink) to guard against infinitely looping on a
circular symlink chain.
@Alexays
Alexays merged commit cece04e into Alexays:master Jul 21, 2024
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.

2 participants