pwnshop: add --log-failures option - #87
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfec5907cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| failed.setdefault(challenge, []).append("<build>") | ||
| failed_count += 1 | ||
| if log_failures: | ||
| log_file = log_failures / challenge / "_build_error.log" |
There was a problem hiding this comment.
Keep failure logs rooted under --log-failures directory
If a user passes an absolute challenge target (which this command accepts), challenge becomes an absolute Path, so log_failures / challenge ignores log_failures and writes logs to the absolute challenge path instead of DIR/.... This means --log-failures can silently write outside the requested directory (or fail with permission errors), which breaks the option’s documented behavior; the joined challenge path should be normalized to a relative path before concatenation.
Useful? React with 👍 / 👎.
Split out of #85. Adds a --log-failures option to the pwnshop test command.