mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Revert "ext/posix: validate permissions argument in posix_mkfifo()"
This reverts commit 6bd97e72b7.
This commit is contained in:
2
NEWS
2
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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user