diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 049d0bfdf19c..226c2fe01f75 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -1227,13 +1227,13 @@ PHP_FUNCTION(posix_setrlimit) Z_PARAM_LONG(max) ZEND_PARSE_PARAMETERS_END(); - if (cur < -1) { - zend_argument_value_error(2, "must be greater or equal to -1"); + if (cur < -1 && cur != (zend_long) RLIM_INFINITY) { + zend_argument_value_error(2, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY"); RETURN_THROWS(); } - if (max < -1) { - zend_argument_value_error(3, "must be greater or equal to -1"); + if (max < -1 && max != (zend_long) RLIM_INFINITY) { + zend_argument_value_error(3, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY"); RETURN_THROWS(); } diff --git a/ext/posix/tests/posix_setrlimit.phpt b/ext/posix/tests/posix_setrlimit.phpt index ea81a944e431..754d68b0ed59 100644 --- a/ext/posix/tests/posix_setrlimit.phpt +++ b/ext/posix/tests/posix_setrlimit.phpt @@ -32,5 +32,5 @@ try { --EXPECT-- bool(true) ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be lower or equal to 128 -ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater or equal to -1 -ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater or equal to -1 +ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY +ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY diff --git a/ext/posix/tests/posix_setrlimit_infinity.phpt b/ext/posix/tests/posix_setrlimit_infinity.phpt new file mode 100644 index 000000000000..3fb4ad5ec135 --- /dev/null +++ b/ext/posix/tests/posix_setrlimit_infinity.phpt @@ -0,0 +1,14 @@ +--TEST-- +posix_setrlimit(): accepts POSIX_RLIMIT_INFINITY +--EXTENSIONS-- +posix +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) diff --git a/ext/session/tests/session_write_close_encode_failure.phpt b/ext/session/tests/session_write_close_encode_failure.phpt index 1c562f401df2..e07cfc9c42e2 100644 --- a/ext/session/tests/session_write_close_encode_failure.phpt +++ b/ext/session/tests/session_write_close_encode_failure.phpt @@ -3,7 +3,12 @@ session_write_close() closes the save handler when encoding the session data fai --EXTENSIONS-- session --SKIPIF-- - + --INI-- session.use_cookies=0 session.cache_limiter= diff --git a/ext/standard/tests/general_functions/proc_open_descriptor_0_setup_failure.phpt b/ext/standard/tests/general_functions/proc_open_descriptor_0_setup_failure.phpt index ea654b0f497a..9a515136cac4 100644 --- a/ext/standard/tests/general_functions/proc_open_descriptor_0_setup_failure.phpt +++ b/ext/standard/tests/general_functions/proc_open_descriptor_0_setup_failure.phpt @@ -8,6 +8,9 @@ if (!function_exists("proc_open")) { if (!@is_dir("/proc/self/fd")) { die("skip requires /proc/self/fd"); } +if (PHP_OS_FAMILY === "Solaris") { + die("skip /proc/self/fd entries are not symlinks on Solaris"); +} ?> --FILE-- --FILE--