-
Notifications
You must be signed in to change notification settings - Fork 250
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
isUnpackedDir
unintentionally unpacks other directories with same dir name prefix
#331
Labels
Comments
mmaietta
added a commit
to electron-userland/electron-builder
that referenced
this issue
Oct 7, 2024
maybe it's the same problem like #303, and the same fix method |
Found a solution. Opening a separate PR |
🎉 This issue has been resolved in version 3.2.17 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello all
I'm working on migrating electron-builder to leverage electron/asar instead of its in-house solution. In one of our unit tests I have the following structure:
test-smart-unpack
is auto-detected by electron-builder to unpack due to the underlying.dll
file, and in turn, that minimatch is passed to electron/asar to unpack that dir with the pattern belowasar/src/asar.ts
Lines 22 to 31 in 464e834
The issue I'm running into is that
test-smart-unpack-empty
is not supposed to be getting unpacked as it fails the minimatch, but theelse
logic inisUnpackedDir
is causing it to do astartsWith
match on the folder path and then returnstrue
.What I think the
else
logic is attempting to do is to determine if thedirPath
is within the tree hierarchy of a previously-unpacked dir. Is that right?asar/src/asar.ts
Line 29 in 464e834
If so, I think an additional check is needed such that we check that the relative path is within the dir path hierarchy, and not just a
startsWith
check.Maybe something like:
dirPath.startsWith(unpackDir) && !path.relative(dirPath, unpackDir).startsWith("../")
?Wanted to post an issue here first to touch base with you all, in case I'm doing something wrong, before diving in deeper to see if I can PR something
The text was updated successfully, but these errors were encountered: