Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Avoid race condition on symlink publishing #2669

Merged
merged 8 commits into from Mar 23, 2022

Conversation

kdambekalns
Copy link
Member

If the symlink could not be created but exists, check if it points to
the expected target and ignore the error in that case.

Fixes #2667

If the symlink could not be created but exists, check if it points to
the expected target and ignore the error in that case.

Fixes #2667
@kdambekalns
Copy link
Member Author

ping…

@kdambekalns
Copy link
Member Author

ping …

1 similar comment
@kdambekalns
Copy link
Member Author

ping …

Copy link
Member

@robertlemke robertlemke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

$result = false;
}

if (Files::is_link($targetPathAndFilename) && realpath($targetPathAndFilename) === realpath($sourcePathAndFilename)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can there be a situation where both realpath return false? (since false === false)
i only know that realpath doesnt like stream wrapper and returns false then ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, well. Technically, yes, that could happen. But I think we can ignore that here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mhsdesign
Copy link
Member

btw i do noticed the odd exception handling and returning arrays and stuff, but fixing this is not a bugfix.

@kdambekalns kdambekalns merged commit cefc133 into 6.3 Mar 23, 2022
@kdambekalns kdambekalns deleted the bugfix/2667-publish-symlink-race-condition branch March 23, 2022 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants