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

results: fix quoting in handle_known_fp_list() #183

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

kdudka
Copy link
Member

@kdudka kdudka commented Aug 16, 2024

... by using shlex.quote() from standard Python library. This bug caused regular expressions with parentheses to be interpreted by shell:

/bin/sh: -c: line 1: syntax error near unexpected token `('

Also avoid using the open-coded shell_quote() function from util.py while printing shell commands in exec_cmd() because the function is rather problematic and should be eventually unimplemented.

Unfortunately, we cannot easily nest shlex.quote() while combining mock --chroot ... with su -c ... and the like because it results in totally unreadable scan.log.

Resolves: https://issues.redhat.com/browse/OSH-617

@kdudka kdudka requested a review from rhyw August 16, 2024 18:27
@kdudka kdudka self-assigned this Aug 16, 2024
... by using `shlex.quote()` from standard Python library.  This bug
caused regular expressions with parentheses to be interpreted by shell:
```
/bin/sh: -c: line 1: syntax error near unexpected token `('
```

Also avoid using the open-coded `shell_quote()` function from `util.py`
while printing shell commands in `exec_cmd()` because the function is
rather problematic and should be eventually unimplemented.

Unfortunately, we cannot easily nest `shlex.quote()` while combining
`mock --chroot ...` with `su -c ...` and the like because it results
in totally unreadable `scan.log`.

Resolves: https://issues.redhat.com/browse/OSH-617
Closes: csutils#183
Copy link
Contributor

@rhyw rhyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also scheduled a task on stage, although the task is still failed, the error message in question is gone.

LGTM

@kdudka
Copy link
Member Author

kdudka commented Aug 19, 2024

@rhyw Thank you for the review and testing!

@kdudka kdudka closed this in 24f29de Aug 19, 2024
@kdudka kdudka merged commit 24f29de into csutils:main Aug 19, 2024
33 checks passed
@kdudka kdudka deleted the shell-quote branch August 19, 2024 08:17
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.

2 participants