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(sca): incorrect parsing of shebangs #1219

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lyoung-confluent
Copy link
Contributor

While working on wolfi-dev/os#19702 I noticed that the parsing of shebangs seems to struggle with some files:

2024/05/17 12:42:10 WARN Error reading shbang from usr/bin/fiologparser_hist.py: a shbang of only '/usr/bin/env' with multiple arguments (9 /usr/bin/env python3 """ Utility for converting *_clat_hist* files gene)

Source: https://github.com/axboe/fio/blob/3ed8eea0ee9b5d7de603e9b128e6c05941b99938/tools/hist/fiologparser_hist.py#L7

The parsing should terminate at the end of the line.

Functional Changes

  • Use bytes.CutPrefix for better clarity
  • Stop parsing at \n if present

SCA Changes

  • Examining several representative APKs show no regression / the desired effect (details in notes)

Notes:

Linter

  • The new check is clean across Wolfi
  • The new check is opt-in or a warning

Notes:

@lyoung-confluent lyoung-confluent changed the title fix: incorrect parsing of shebangs fix(sca): incorrect parsing of shebangs May 17, 2024
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.

1 participant