fix: ensure patch utility is gnu version#258
Closed
curbengh wants to merge 1 commit intosnyk:masterfrom
curbengh:check-gnu-patch
Closed
fix: ensure patch utility is gnu version#258curbengh wants to merge 1 commit intosnyk:masterfrom curbengh:check-gnu-patch
curbengh wants to merge 1 commit intosnyk:masterfrom
curbengh:check-gnu-patch
Conversation
3 tasks
Contributor
|
@weyusi please check a release newer than 1.131.0. |
This was referenced Apr 7, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This pull adds a check to test whether
patchbinary is GNU version and outputs an error message if it's not.How should this be manually tested?
snyk protectSnyk couldn't patch the specified vulnerabilities because GNU's patch is not available. Please install 'patch' and try again..apk add patch.Current behavior
With this pull
Alpine 3.8:
TrueOS 18.03 (FreeBSD 12):
Without GNU patch

With GNU patch

Any background context you want to provide?
Alpine and *BSD ships with BusyBox and BSD versions of
patchrespectively, which don't support the arguments (i.e.--backupin BusyBox and--verbosein BSD) used by Synk.This pull helps those OS users to locate the issue, even without
--debug.What are the relevant tickets?
Closes #108 @welwood08
Additional questions
patchbinary. Please clarify.hasbin()can be replaced byif(error)inexec(). Shall I remove it?https://github.com/snyk/snyk/blob/c98b8b39779410f70027eab31a97dd910994f332/test/patch-ensure-patch.js#L33