tester-report: scrub a value that follows a colour escape #595

Open
github-bot wants to merge 1 commit from github-bot/gh-591 into main AGit
Owner

@⁠xarvel-temp on GitHub · 2026-11-28 10:41 UTC · original
xarvel-temp:scrub-on-main → main · +9 −1 · 2 files · 1 commits · open

tools/macos/tester-report.sh leaves a tester's Mac name (and would leave a user name) in the log it calls scrubbed, whenever the value sits straight after a colour escape.

Why

The scrubber keeps a value when the character before it is alphanumeric, so that a short user name like lee does not turn release into <user>release. A colour escape ends in the letter m (ESC[0m), and tracing writes field values immediately after one — ESC[2m=ESC[0m<value>. That m looks like a word character, so the value is never replaced.

What it looked like here

Running the script on a normal windowed run, the gzipped "scrubbed" log still carried my Mac's name twice:

victory_hle::host_posix::winsock: network name lookup blocked name=<my-mac>.local

The home path and user name happened to survive the same guard only because they start with / or appear after = in uncoloured text. Any value that begins with a letter or digit right after a colour reset is exposed.

The fix

Treat a trailing colour escape as no character at all, so the word-boundary guard does not see its m. Nine lines, no behaviour change anywhere else: a short name still leaves release alone, because the guard is unchanged for ordinary text.

Test

tools/macos/tests/tester-report.sh did not catch this: its synthetic log writes host=@HOST@ with an uncoloured =, which is not the shape the logger produces. This adds one log line in the real shape and one assertion. Without the fix the suite fails with

FAIL: 'Fakes-MacBook-Pro' survived in the scrubbed

and passes with it. Verified both ways on this branch, and on my own run the line now reads name=<host>.

Found while preparing a tester report on an M5 Max; I have not claimed an issue for it, as it is a one-commit fix to the reporting tool rather than work on the port.

**@⁠xarvel-temp** on GitHub · 2026-11-28 10:41 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/591) `xarvel-temp:scrub-on-main` → `main` · +9 −1 · 2 files · 1 commits · open `tools/macos/tester-report.sh` leaves a tester's Mac name (and would leave a user name) in the log it calls scrubbed, whenever the value sits straight after a colour escape. ### Why The scrubber keeps a value when the character before it is alphanumeric, so that a short user name like `lee` does not turn `release` into `<user>release`. A colour escape ends in the letter **`m`** (`ESC[0m`), and `tracing` writes field values immediately after one — `ESC[2m=ESC[0m<value>`. That `m` looks like a word character, so the value is never replaced. ### What it looked like here Running the script on a normal windowed run, the gzipped "scrubbed" log still carried my Mac's name twice: ``` victory_hle::host_posix::winsock: network name lookup blocked name=<my-mac>.local ``` The home path and user name happened to survive the same guard only because they start with `/` or appear after `=` in uncoloured text. Any value that begins with a letter or digit right after a colour reset is exposed. ### The fix Treat a trailing colour escape as no character at all, so the word-boundary guard does not see its `m`. Nine lines, no behaviour change anywhere else: a short name still leaves `release` alone, because the guard is unchanged for ordinary text. ### Test `tools/macos/tests/tester-report.sh` did not catch this: its synthetic log writes `host=@HOST@` with an uncoloured `=`, which is not the shape the logger produces. This adds one log line in the real shape and one assertion. Without the fix the suite fails with ``` FAIL: 'Fakes-MacBook-Pro' survived in the scrubbed ``` and passes with it. Verified both ways on this branch, and on my own run the line now reads `name=<host>`. Found while preparing a tester report on an M5 Max; I have not claimed an issue for it, as it is a one-commit fix to the reporting tool rather than work on the port.
The scrubber treats a value as part of a longer word when the character
before it is alphanumeric, so that a short user name like "lee" does not
turn "release" into "<user>release". A colour escape ends in "m", and
tracing writes field values straight after one (ESC[2m=ESC[0m<value>), so
every host and user name in that position was left in the "scrubbed" log.

On this Mac the report kept "<hostname>.local" in two winsock lines.

Treat a trailing colour escape as no character at all, and give the test a
log line in the shape the logger actually writes: without the fix it fails
with "'Fakes-MacBook-Pro' survived in the scrubbed".
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 10:42:08 +00:00
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 16:54 UTC · original · approved these changes

Read the diff and ran the test locally on the head fb0389cf: bash tools/macos/tests/tester-report.sh → PASS: tester-report, including the new case (a value straight after ESC[2m…ESC[0m now scrubs). The awk change is minimal and the boundary rule (a colour escape's trailing m is not a word char before the value) matches how tracing writes field values. Approving from my side; CI green on main-side checks.

**@⁠AnastasisKon** on GitHub · 2026-11-28 16:54 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/591#pullrequestreview-6099146049) · **approved these changes** Read the diff and ran the test locally on the head fb0389cf: `bash tools/macos/tests/tester-report.sh` → `PASS: tester-report`, including the new case (a value straight after `ESC[2m…ESC[0m` now scrubs). The awk change is minimal and the boundary rule (a colour escape's trailing `m` is not a word char before the value) matches how tracing writes field values. Approving from my side; CI green on main-side checks.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/595/head:github-bot/gh-591'
git switch 'github-bot/gh-591'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-591'
git switch 'github-bot/gh-591'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-591'
git switch 'github-bot/gh-591'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-591'
git switch 'main'
git merge --squash 'github-bot/gh-591'
git switch 'main'
git merge --ff-only 'github-bot/gh-591'
git switch 'main'
git merge 'github-bot/gh-591'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.