Commit b3c259c13c9 for php.net
commit b3c259c13c9d0fa9014ca59adcbdd09212bed670
Author: David Carlier <devnexen@gmail.com>
Date: Mon Feb 16 17:49:37 2026 +0000
Revert "ext/posix: validate permissions argument in posix_mkfifo()"
This reverts commit 6bd97e72b719599b3110fd5ec543b2996f52ba63.
diff --git a/NEWS b/NEWS
index e6688bb6791..dae787ab53f 100644
--- a/NEWS
+++ b/NEWS
@@ -80,8 +80,6 @@ PHP NEWS
- Posix:
. Added validity check to the flags argument for posix_access(). (arshidkv12)
- . Added validity check to the permissions argument for posix_mkfifo().
- (arshidkv12)
- Reflection:
. Fixed bug GH-20217 (ReflectionClass::isIterable() incorrectly returns true
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index a81372349fd..76e14f6ecb0 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -621,11 +621,6 @@ PHP_FUNCTION(posix_mkfifo)
RETURN_FALSE;
}
- if (mode < 0 || (mode & ~07777)) {
- zend_argument_value_error(2, "must be between 0 and 0o7777");
- RETURN_THROWS();
- }
-
result = mkfifo(ZSTR_VAL(path), mode);
if (result < 0) {
POSIX_G(last_error) = errno;
diff --git a/ext/posix/tests/posix_mkfifo_invalid_mode.phpt b/ext/posix/tests/posix_mkfifo_invalid_mode.phpt
deleted file mode 100644
index 5c9f251adfc..00000000000
--- a/ext/posix/tests/posix_mkfifo_invalid_mode.phpt
+++ /dev/null
@@ -1,36 +0,0 @@
---TEST--
-posix_mkfifo(): invalid mode argument
---SKIPIF--
-<?php
-if (!function_exists("posix_mkfifo")) {
- die("skip no posix_mkfifo()");
-}
-?>
---FILE--
-<?php
-
-// Negative mode
-try {
- posix_mkfifo(__DIR__ . "/testfifo1", -1);
-} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
-}
-
-// Too large mode
-try {
- posix_mkfifo(__DIR__ . "/testfifo2", 010000); // > 07777
-} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
-}
-
-// Garbage bits
-try {
- posix_mkfifo(__DIR__ . "/testfifo3", 020000); // S_IFCHR bit
-} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
-}
-?>
---EXPECTF--
-posix_mkfifo(): Argument #2 ($permissions) must be between 0 and 0o7777
-posix_mkfifo(): Argument #2 ($permissions) must be between 0 and 0o7777
-posix_mkfifo(): Argument #2 ($permissions) must be between 0 and 0o7777