You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding a new binary catalog using the make add-snippet command fails in some cases.
The reason for this problem is here: capture-snippet.sh:119. In cases where the input variable SELECTED_RESULT contains leading blanks, the OFFSET calculation will lead to an empty result.
Steps to reproduce the issue:
cd syft/pkg/cataloger/binary/test-fixtures
make
make add-snippet
Then select: classifiers/bin/curl/8.9.1/linux-amd64/curl and choose one of the found maches:
Pattern not found.
Error: command execution failed: exit status 1
Usage:
manager add-snippet [flags]
Flags:
-h, --help help for add-snippet
--length int the length of the snippet to capture (default 100)
--prefix-length int number of bytes before the search hit to capture (default 20)
--search-for string the pattern to search for in the binary (defaults to the version)
command execution failed: exit status 1
exit status 1
make: *** [Makefile:23: add-snippet] Error 1
What you expected to happen:
The process contiues wihout error, like this:
1) 167585 curl/8.9.1
2) 174376 curl 8.9.1 (x86_64-pc-linux-musl) %s
Please select a match: 2
0002a914: 616c 206f 7220 222d 2d68 656c 7020 616c al or "--help al
0002a924: 6c22 2e00 6375 726c 2038 2e39 2e31 2028 l"..curl 8.9.1 (
0002a934: 7838 365f 3634 2d70 632d 6c69 6e75 782d x86_64-pc-linux-
0002a944: 6d75 736c 2920 2573 0a00 0000 5741 524e musl) %s....WARN
0002a954: 494e 473a 2063 7572 6c20 616e 6420 6c69 ING: curl and li
0002a964: 6263 7572 6c20 7665 7273 696f 6e73 2064 bcurl versions d
0002a974: 6f20 6e6f 7420 6d61 7463 682e 2046 756e o not match. Fun
0002a984: 6374 696f 6e61 6c69 ctionali
Does this snippet capture what you need? (Y/n/q) y
wrote snippet to "classifiers/snippets/curl/8.9.1/linux-amd64/curl"
Environment:
syft main branch latest
The text was updated successfully, but these errors were encountered:
Adding a new binary catalog using the
make add-snippet
command fails in some cases.The reason for this problem is here: capture-snippet.sh:119. In cases where the input variable
SELECTED_RESULT
contains leading blanks, theOFFSET
calculation will lead to an empty result.Steps to reproduce the issue:
Then select:
classifiers/bin/curl/8.9.1/linux-amd64/curl
and choose one of the found maches:Then the process fails with:
What you expected to happen:
The process contiues wihout error, like this:
Environment:
The text was updated successfully, but these errors were encountered: