ext/posix: validate mode argument in posix_mkfifo()#21102
Open
arshidkv12 wants to merge 8 commits intophp:masterfrom
Open
ext/posix: validate mode argument in posix_mkfifo()#21102arshidkv12 wants to merge 8 commits intophp:masterfrom
arshidkv12 wants to merge 8 commits intophp:masterfrom
Conversation
Member
|
kind of make sense, |
devnexen
reviewed
Jan 31, 2026
ext/posix/posix.c
Outdated
| RETURN_FALSE; | ||
| } | ||
|
|
||
| if (mode < 0 || (mode & ~0777)) { |
Member
There was a problem hiding this comment.
... however I m unsure the mask is correct , should not it be ~07777 ?
Contributor
Author
There was a problem hiding this comment.
0777 -> rwx rwx rwx
Member
There was a problem hiding this comment.
I double checked, with FIFO these extra bits, while not wrong, are no-op. Your agument is valid. I ll defer the decision to the maintainer(s).
devnexen
reviewed
Jan 31, 2026
devnexen
reviewed
Jan 31, 2026
Member
|
Looking good except I tend to disagree where the test is. Ideally, it would have its own dedicated test (and testing more broadly the boundaries). |
devnexen
reviewed
Jan 31, 2026
devnexen
reviewed
Feb 1, 2026
Member
|
Looking good now ; let's it cool down for a while though. |
Girgias
reviewed
Feb 3, 2026
Member
Girgias
left a comment
There was a problem hiding this comment.
Is the max mode really 0o7777?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Validate the mode argument in
posix_mkfifo()and throw aValueErrorfor invalid permission values.