-
Notifications
You must be signed in to change notification settings - Fork 292
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
Cleanups from PR review #1813
Cleanups from PR review #1813
Conversation
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
pkg/buildpack/buildpack.go
Outdated
// write the rest of the package | ||
var header *tar.Header | ||
for { | ||
header, err = tr.Next() |
Check failure
Code scanning / CodeQL
Arbitrary file write during zip extraction ("zip slip")
if origVersion == "" { | ||
// the first header only contains the id - e.g., /cnb/buildpacks/<buildpack-id>, | ||
// read the next header to get the version | ||
secondHeader, err := tr.Next() |
Check failure
Code scanning / CodeQL
Arbitrary file write during zip extraction ("zip slip")
a2b867e
to
d43dfb9
Compare
Signed-off-by: Natalie Arellano <narellano@vmware.com>
0fc0ae4
to
84ee822
Compare
Finally all the tests are passing (though Codecov & CodeQL are not happy): https://github.com/buildpacks/pack/actions/runs/5394788057/jobs/9796440626?pr=1813 I'll point this back to the feature branch for @jjbustamante to review... |
if !module.ContainsFlattenedModules() { | ||
return handleSingleOrEmptyModule(dest, module) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recursive function can handle the case where the module contains a single buildpack
Signed-off-by: Natalie Arellano <narellano@vmware.com>
blobOpts = append(blobOpts, Flattened()) | ||
} | ||
if desc.Info().Match(md.ModuleInfo) { // This is the order buildpack of the package | ||
if desc.Info().Match(md.ModuleInfo) { // Current module is the order buildpack of the package | ||
mainBP = FromBlob(&desc, b, blobOpts...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we are removing method ContainsFlattenedModules()
, I think we can also remove the BlobOption
Hopefully simplifying some things from #1787 (pointing to main for now, just to see the tests run)