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

module: Revert "preserve symlinks when requiring" #6721

Closed
wants to merge 2 commits into from

Conversation

saper
Copy link

@saper saper commented May 12, 2016

After much discussion, it seems that the change broke the way require
detects unique identity of the binary modules. While resolving module's
full path is not sufficient and maybe even not elegant (like anything that
requires the use of realpath() except for certain security scenarios), we
cannot break multiple inclusions of binary modules across symlinked,
substed or otherwise hidden paths.

Add a test case for the binary module loaded twice.

This reverts commit de1dc0a.

saper added 2 commits May 12, 2016 22:11
After much discussion, it seems that the change
broke the way require detects unique identity of
the binary modules. While resolving module's
full path is not sufficient and maybe even
not elegant (like anything that requires the use
of realpath() except for certain security scenarios),
we cannot break multiple inclusions of binary
modules across symlinked, substed or otherwise
hidden paths.

There should be a test case invoving a binary
module to check for issues related to the binary
module identity.

This reverts commit de1dc0a.
Attempt to load the binary module disguised
behind two symlinked locations.

Big thanks to Michael Mifsud <[email protected]>
for preparing a proper test case.
@Fishrock123 Fishrock123 added the module Issues and PRs related to the module subsystem. label May 12, 2016
@jasnell
Copy link
Member

jasnell commented May 12, 2016

-1 the direction in #6537 accurately reflects the decision made by the ctc last week to restore the pre-v6 behavior by default but to preserve the new behavior behind a runtime flag. It was decided that a full revert was not ideal. #6537 includes a revised version of your test case that passes under the default behavior without using the run time flag.

@saper
Copy link
Author

saper commented May 13, 2016

@jasnell thanks, I wasn't aware of the @nodejs/ctc decision. That said, I have put forth my issues with the #6537 approach in that pull request.

@silverwind
Copy link
Contributor

Is this still relevant now that 5d38d54 has landed?

@jasnell
Copy link
Member

jasnell commented May 17, 2016

No, it can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module Issues and PRs related to the module subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants