Skip to content

Posix: Do not treat arguments as FilePath - #320

Merged
tomjaguarpaw merged 1 commit into
haskell:masterfrom
mmhat:319-null-byte-arguments
Aug 16, 2024
Merged

Posix: Do not treat arguments as FilePath#320
tomjaguarpaw merged 1 commit into
haskell:masterfrom
mmhat:319-null-byte-arguments

Conversation

@mmhat

@mmhat mmhat commented Jun 22, 2024

Copy link
Copy Markdown
Contributor

Fixes #319

@tomjaguarpaw

Copy link
Copy Markdown
Member

This looks pretty plausible to me, but I'm not an expert with the low level details. There are various people who are better qualified. Perhaps one of them can chime in.

@bgamari @hasufell @snoyberg @Mistuke (or someone else?)

@hasufell

Copy link
Copy Markdown
Member

There are two differences:

  1. withFilePath uses getFileSystemEncoding, withCString uses getForeignEncoding
  2. withFilePath checks for interior nulls now (not sure since which base version) and barfs out in case it finds any

Tbh, all of those s*ck. But that's another discussion: #252

Comment thread System/Process/Posix.hs
@mmhat

mmhat commented Aug 9, 2024

Copy link
Copy Markdown
Contributor Author
  1. withFilePath checks for interior nulls now (not sure since which base version) and barfs out in case it finds any

I think it is since base-4.18.0.0 (GHC 9.6.1).

If there are no further objections: Who is willing to merge this?

@tomjaguarpaw
tomjaguarpaw merged commit 8d73906 into haskell:master Aug 16, 2024
@tomjaguarpaw

Copy link
Copy Markdown
Member

OK, released as https://hackage.haskell.org/package/process-1.6.22.0. Thanks @mmhat!

@mmhat
mmhat deleted the 319-null-byte-arguments branch August 16, 2024 14:14
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.

NUL byte disallowed in arguments

4 participants