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

Open
xarvel-temp wants to merge 1 commit from upstream-pr/591 into main
xarvel-temp commented 2026-11-28 10:41:11 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by xarvel-temp on 2026-11-28T10:41:11Z.


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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5539276221 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/591). Originally posted by [xarvel-temp](https://github.com/xarvel-temp) on 2026-11-28T10:41:11Z. --- `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.
AnastasisKon commented 2026-11-28 16:54:14 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T16:54:14Z.

Review: APPROVED


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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6099146049 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/591#pullrequestreview-6099146049). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T16:54:14Z. **Review:** APPROVED --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/591:upstream-pr/591'
git switch 'upstream-pr/591'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/591'
git switch 'upstream-pr/591'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/591'
git switch 'upstream-pr/591'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/591'
git switch 'main'
git merge --squash 'upstream-pr/591'
git switch 'main'
git merge --ff-only 'upstream-pr/591'
git switch 'main'
git merge 'upstream-pr/591'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS!591
No description provided.