Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the roh-viz helper script to stream bcftools roh output via zcat instead of zless, aiming to remove the dependency on less in minimal/container environments.
Changes:
- Replace
zlesspipe withzcatwhen reading the RoH input file. - Update the corresponding close error message (though it currently references the wrong option key).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The close error message references `$$opts{in_file}`, but this function opens `$$opts{roh_file}` and there is no `in_file` option in this script. This will produce a misleading/empty error message if the pipe fails; update it to refer to the RoH input and ideally include the underlying failure info (e.g., `$!` and/or `$?`).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Using one-arg open with a piped string command (`open(my $in, "zcat $$opts{roh_file} |")`) invokes a shell and lets it interpret `$$opts{roh_file}`, enabling OS command injection if that value is attacker-controlled. Here `roh_file` comes directly from CLI arguments, so a crafted filename containing shell metacharacters could execute arbitrary commands with this script’s privileges. Replace this with a shell-free invocation (e.g., multi-arg `open` or a decompression module that takes the filename as a separate argument) and/or strictly validate the allowed pathname characters.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Still need to enable all flags zless uses, especially -f and -q to transparently handle uncompressed files.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Hi.
Reading the code, I think you don't need the "less" capability of
zlessinroh-viz. I think the script just needs a plain-text stream of a potentially-compressed input file. Sincelessis an extra dependency that is not necessarily installed, especially in containers, and is just a wrapper aroundgzip, I propose to invokegunzipdirectly.Importantly, it needs the
-fand-qoptionzlessuses to transparently handle uncompressed files.I also address two issues Copilot found during its review:
Best regards,
Matthieu