Skip to content

navmesh_links: protect archive and carved streams from report aliases - #4747

Open
illusionart453-max wants to merge 1 commit into
ItsNotRexed:mainfrom
illusionart453-max:fix/navmesh-links-output-alias
Open

illusionart453-max wants to merge 1 commit into
ItsNotRexed:mainfrom
illusionart453-max:fix/navmesh-links-output-alias

Conversation

@illusionart453-max

Copy link
Copy Markdown

An --out hard link bypasses the archive abspath check, and a report can also replace a consumed .bin stream in a carved directory. Compare using report_paths.same_report_path for both input modes before scanning. Synthetic CLI tests reproduce the original corruption and verify preserved archive/stream bytes for direct and hard-link paths. Existing successful-report coverage passes.

Claimed as a new BUILD/TEST item (ID pending assignment)
#4683 (comment)

Verified on Windows 11, Python 3.15.2, CPU only.

  • python -I tests/test_navmesh_links.py passed 4 tests. The new regression failed in 3 subcases before the fix.
  • git diff --check passed.

AI-assisted (Codex). Synthetic inputs only.
Depends on no other PR.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ran this at dfa770107 on Windows 11: pytest tests/test_navmesh_links.py -q -> 4 passed, 13 subtests passed; git diff --check clean.

The report path is now checked against both the archive and the carved streams before the scan (same path, .., links), so a report alias cannot overwrite either input; the added subtests cover the archive alias, the carved-stream alias and the ordinary output. No blocking issue.

@Atomic258

Copy link
Copy Markdown
Contributor

Independent verification at head dfa77010702a682816d4781a12fe9f647c3cce25 on Windows 11, Python 3.15.2 (python -I, stdlib only).

  • python -I tests/test_navmesh_links.py — 4 tests, OK (the "--out must not overwrite the input path" line is an expected error-path subcase)
  • git diff --check origin/main...HEAD — clean
  • Red control: git checkout origin/main -- tools/navmesh_links.py (PR test kept) → test_report_preserves_archive_and_carved_input_aliases fails in 3 subcases — the report overwrites the carved .bin stream (assertEqual on stream bytes fails); restored → 4 tests OK. Worktree left clean.

Matches the PR description: archive + carved-stream alias protection verified. No issues found. AI-assisted (Devin).

@memorypressure

Copy link
Copy Markdown

Merged cleanly with current main and green: test_navmesh_links.py 4/4 — direct-path and hard-link cases confirm the archive and the carved .bin stream are preserved and the command exits 2 — with test_navmesh_decode (15) and test_report_paths (15) unchanged. The guard uses the same .bin filter as the carved scanner, so coverage matches what the tool actually reads. Same purpose as #4748 in a different tool, no shared files. No CI checks were reported. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@Atomic258

Copy link
Copy Markdown
Contributor

Tested dfa7701 on Windows Server 2022, CPython 3.13.12: pass

  • python -I tests/test_navmesh_links.py -> OK

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

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.

4 participants