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

fix(fs): Fixes the Zip magic fd bits #4737

Merged
merged 5 commits into from Aug 12, 2022
Merged

fix(fs): Fixes the Zip magic fd bits #4737

merged 5 commits into from Aug 12, 2022

Conversation

arcanis
Copy link
Member

@arcanis arcanis commented Aug 11, 2022

What's the problem this PR addresses?

We currently use 0x80000000 as magic bits to detect whether a file descriptor is owned by the ZipOpenFS layer or not. This causes all such file descriptors to become invalid, because they overflow into negative integers.

Ref evanw/esbuild#2458 (still not fixed, because of the other problem described in evanw/esbuild#2458 (comment))

How did you fix it?

Changes the magic bits into 0x2a000000.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

Copy link
Member

@merceyz merceyz left a comment

Choose a reason for hiding this comment

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

This PR does a bit more than the description specifies, explicitly blocking this to make sure either is updated.

@arcanis arcanis requested a review from merceyz August 12, 2022 08:20
Copy link
Member

@merceyz merceyz left a comment

Choose a reason for hiding this comment

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

Need to update

as well, I'm surprised all the tests pass without it.

packages/yarnpkg-fslib/sources/ZipOpenFS.ts Outdated Show resolved Hide resolved
.yarn/versions/70c62085.yml Outdated Show resolved Hide resolved
@arcanis arcanis requested a review from merceyz August 12, 2022 08:30
@arcanis arcanis merged commit 380b32b into master Aug 12, 2022
@arcanis arcanis deleted the mael/zip-magic-fd branch August 12, 2022 09:00
merceyz pushed a commit that referenced this pull request Aug 19, 2022
* Fixes the Zip magic fd bits

* Reverts changes to the readdir signatures

* Reverts extra changes

* Updates the hook

* Feedback
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.

None yet

2 participants