mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:45:53 +01:00
[PR #2293] tools/int_hw_probe.py: harden realpath --json validation and --hw-arch/--group checks #2298
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2298
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2293
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/int-hw-probe-realpath-guard📝 Commits (1)
6a0a434tools/int_hw_probe.py: validate realpath JSON targets, --hw-arch, and blank --group📊 Changes
2 files changed (+57 additions, -12 deletions)
View changed files
📝
tests/test_int_hw_probe.py(+32 -0)📝
tools/int_hw_probe.py(+25 -12)📄 Description
Claimed in the coordination issue as: INT-HW-PROBE-REALPATH-JSON-GUARD-AND-CLI-VALIDATION (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7192551919)
What and why
os.path.realpath(out_path)in_validate_json_out()(tools/int_hw_probe.py) so symlinked directories and non-directory ancestors along the resolved target are rejected withERROR:and exit code2before running translator or hardware probes.--hw-archupfront inmain(): reject empty--hw-archvalues and reject--hw-archwhen--oracle translatoris selected (exit code2).--groupentries withERROR: --group must not be emptyand exit code2.tests/test_int_hw_probe.py.Tested
python -I tests/test_int_hw_probe.py -v: 14 passed, 0 failed (detachedupstream/mainbaseline with only the updated test file fails with 6 failures).python -I tests/test_ci_registration.py: 16 passed.python -I tests/test_text_write_line_endings.py: 3 passed.python -I scripts/check_no_game_data.py,python -I -m compileall -q tools/int_hw_probe.py tests/test_int_hw_probe.py, andgit diff --cached --check: passed.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.