Skip to content

Validate UseTextForParameters as a file name - #1893

Merged
SimonCropp merged 1 commit into
mainfrom
fix-use-text-for-parameters-guard
Aug 29, 2026
Merged

Validate UseTextForParameters as a file name#1893
SimonCropp merged 1 commit into
mainfrom
fix-use-text-for-parameters-guard

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

The text is appended to the snapshot file name verbatim, with no FileNameCleaner pass, but it was validated with AgainstBadExtension, which only rejects a leading period and directory separators. The sibling naming APIs UseFileName, UseTypeName and UseMethodName all use the file name guard.

So UseTextForParameters($"{time:HH:mm}") put a ':' in the path: on Windows the received write silently went to an NTFS alternate data stream, so no received file appeared at all, and on net4x it failed deep in IO rather than as a clear argument error. '*' and '?' failed at write time.

'#' is rejected too, since it starts the indexed-target namespace and would make one case's files look like another case's targets.

The text is appended to the snapshot file name verbatim, with no FileNameCleaner
pass, but it was validated with AgainstBadExtension, which only rejects a
leading period and directory separators. The sibling naming APIs UseFileName,
UseTypeName and UseMethodName all use the file name guard.

So UseTextForParameters($"{time:HH:mm}") put a ':' in the path: on Windows the
received write silently went to an NTFS alternate data stream, so no received
file appeared at all, and on net4x it failed deep in IO rather than as a clear
argument error. '*' and '?' failed at write time.

'#' is rejected too, since it starts the indexed-target namespace and would make
one case's files look like another case's targets.
@SimonCropp SimonCropp added this to the 33.0.0 milestone Aug 29, 2026
@SimonCropp
SimonCropp merged commit 8594ebc into main Aug 29, 2026
6 of 7 checks passed
@SimonCropp
SimonCropp deleted the fix-use-text-for-parameters-guard branch August 29, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant