Skip to content

Sanitize output file names - #775

Open
Mzack9999 wants to merge 1 commit into
devfrom
log-name-sanitize
Open

Mzack9999 wants to merge 1 commit into
devfrom
log-name-sanitize

Conversation

@Mzack9999

Copy link
Copy Markdown
Member

Closes #774

Proposed changes

  • The Host value used in log file names keeps only [A-Za-z0-9._:-]; every other character (path separators included) becomes _.
  • The file logger refuses to write a file whose path is not directly inside the output folder.

Proof

New tests TestSaveRejectsNameOutsideFolder and TestStoreWriterKeepsFilesInLogFolder. pkg/logger and pkg/logger/file tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant