summaryrefslogtreecommitdiff
path: root/ext/posix
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-02-01 21:25:15 +0100
committerOndřej Surý <ondrej@sury.org>2012-02-01 21:25:15 +0100
commit96fb2ff5760132a915766f1d9ec7c63001feacd8 (patch)
tree160904a89a8f3522fa4e47632db101b045e7814a /ext/posix
parent8f1428d29ef91d74b4d272af171675f2971eb15b (diff)
downloadphp-96fb2ff5760132a915766f1d9ec7c63001feacd8.tar.gz
Imported Upstream version 5.4.0~rc6upstream/5.4.0_rc6
Diffstat (limited to 'ext/posix')
-rw-r--r--ext/posix/posix.c27
-rw-r--r--ext/posix/tests/posix_access.phpt5
-rw-r--r--ext/posix/tests/posix_access_error_modes.phpt7
-rw-r--r--ext/posix/tests/posix_access_error_wrongparams.phpt5
-rw-r--r--ext/posix/tests/posix_access_safemode.phpt5
-rw-r--r--ext/posix/tests/posix_getgrgid_variation.phpt10
-rw-r--r--ext/posix/tests/posix_getpgid_variation.phpt10
-rw-r--r--ext/posix/tests/posix_getpwuid_variation.phpt10
-rw-r--r--ext/posix/tests/posix_kill_variation1.phpt10
-rw-r--r--ext/posix/tests/posix_kill_variation2.phpt10
-rw-r--r--ext/posix/tests/posix_mkfifo_safemode.phpt5
-rw-r--r--ext/posix/tests/posix_strerror_variation1.phpt10
-rw-r--r--ext/posix/tests/posix_times_basic.phpt10
13 files changed, 87 insertions, 37 deletions
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 557252aeb..0b1b11901 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -838,16 +838,11 @@ PHP_FUNCTION(posix_mkfifo)
long mode;
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &path, &path_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &path, &path_len, &mode) == FAILURE) {
RETURN_FALSE;
}
- if (strlen(path) != path_len) {
- RETURN_FALSE;
- }
-
- if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) ||
- (PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR)))) {
+ if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
RETURN_FALSE;
}
@@ -876,17 +871,12 @@ PHP_FUNCTION(posix_mknod)
php_dev = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ll", &path, &path_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl|ll", &path, &path_len,
&mode, &major, &minor) == FAILURE) {
RETURN_FALSE;
}
- if (strlen(path) != path_len) {
- RETURN_FALSE;
- }
-
- if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) ||
- (PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR)))) {
+ if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
RETURN_FALSE;
}
@@ -961,11 +951,7 @@ PHP_FUNCTION(posix_access)
int filename_len, ret;
char *filename, *path;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &mode) == FAILURE) {
- RETURN_FALSE;
- }
-
- if (strlen(filename) != filename_len) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -975,8 +961,7 @@ PHP_FUNCTION(posix_access)
RETURN_FALSE;
}
- if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) ||
- (PG(safe_mode) && (!php_checkuid_ex(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR, CHECKUID_NO_ERRORS)))) {
+ if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
efree(path);
POSIX_G(last_error) = EPERM;
RETURN_FALSE;
diff --git a/ext/posix/tests/posix_access.phpt b/ext/posix/tests/posix_access.phpt
index e585e67b4..47b5e15f0 100644
--- a/ext/posix/tests/posix_access.phpt
+++ b/ext/posix/tests/posix_access.phpt
@@ -13,9 +13,10 @@ if (!extension_loaded('posix')) {
if (posix_geteuid() == 0) {
die('SKIP Cannot run test as root.');
}
+if (PHP_VERSION_ID < 503099) {
+ die('SKIP Safe mode is no longer available.');
+}
?>
---INI--
-safe_mode = 1
--FILE--
<?php
$filename = dirname(__FILE__) . '/foo.test';
diff --git a/ext/posix/tests/posix_access_error_modes.phpt b/ext/posix/tests/posix_access_error_modes.phpt
index 951ae0107..fb04e3468 100644
--- a/ext/posix/tests/posix_access_error_modes.phpt
+++ b/ext/posix/tests/posix_access_error_modes.phpt
@@ -13,9 +13,10 @@ if (!extension_loaded('posix')) {
if (posix_geteuid() == 0) {
die('SKIP Cannot run test as root.');
}
+if (PHP_VERSION_ID < 503099) {
+ die('SKIP Safe mode is no longer available.');
+}
?>
---INI--
-safe_mode = 1
--FILE--
<?php
$filename = dirname(__FILE__) . '/foo.test';
@@ -37,7 +38,7 @@ chmod ($filename, 0700);
unlink($filename);
?>
--EXPECTF--
-Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line %d
+WDeprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line %d
bool(false)
bool(false)
bool(false)
diff --git a/ext/posix/tests/posix_access_error_wrongparams.phpt b/ext/posix/tests/posix_access_error_wrongparams.phpt
index 111ec6c54..35556a13a 100644
--- a/ext/posix/tests/posix_access_error_wrongparams.phpt
+++ b/ext/posix/tests/posix_access_error_wrongparams.phpt
@@ -13,9 +13,10 @@ if (!extension_loaded('posix')) {
if (posix_geteuid() == 0) {
die('SKIP Cannot run test as root.');
}
+if (PHP_VERSION_ID < 503099) {
+ die('SKIP Safe mode is no longer available.');
+}
?>
---INI--
-safe_mode = 1
--FILE--
<?php
diff --git a/ext/posix/tests/posix_access_safemode.phpt b/ext/posix/tests/posix_access_safemode.phpt
index ec0c3e8d8..b726b4fdb 100644
--- a/ext/posix/tests/posix_access_safemode.phpt
+++ b/ext/posix/tests/posix_access_safemode.phpt
@@ -11,8 +11,9 @@ if (!extension_loaded('posix')) {
if (posix_geteuid() == 0) {
die('SKIP Cannot run test as root.');
}
---INI--
-safe_mode = 1
+if (PHP_VERSION_ID < 503099) {
+ die('SKIP Safe mode is no longer available.');
+}
--FILE--
<?php
var_dump(posix_access('/tmp', POSIX_W_OK));
diff --git a/ext/posix/tests/posix_getgrgid_variation.phpt b/ext/posix/tests/posix_getgrgid_variation.phpt
index 13db73b79..5cce391d7 100644
--- a/ext/posix/tests/posix_getgrgid_variation.phpt
+++ b/ext/posix/tests/posix_getgrgid_variation.phpt
@@ -103,26 +103,36 @@ valid output
Arg value 0.5
valid output
+Notice: Array to string conversion in %sposix_getgrgid_variation.php on line %d
+
Arg value Array
Warning: posix_getgrgid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getgrgid_variation.php on line %d
+
Arg value Array
Warning: posix_getgrgid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getgrgid_variation.php on line %d
+
Arg value Array
Warning: posix_getgrgid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getgrgid_variation.php on line %d
+
Arg value Array
Warning: posix_getgrgid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getgrgid_variation.php on line %d
+
Arg value Array
Warning: posix_getgrgid() expects parameter 1 to be long, array given in %s on line %d
diff --git a/ext/posix/tests/posix_getpgid_variation.phpt b/ext/posix/tests/posix_getpgid_variation.phpt
index e53d58f39..b9c92b539 100644
--- a/ext/posix/tests/posix_getpgid_variation.phpt
+++ b/ext/posix/tests/posix_getpgid_variation.phpt
@@ -103,26 +103,36 @@ valid output
Arg value 0.5
valid output
+Notice: Array to string conversion in %sposix_getpgid_variation.php on line %d
+
Arg value Array
Warning: posix_getpgid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getpgid_variation.php on line %d
+
Arg value Array
Warning: posix_getpgid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getpgid_variation.php on line %d
+
Arg value Array
Warning: posix_getpgid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getpgid_variation.php on line %d
+
Arg value Array
Warning: posix_getpgid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getpgid_variation.php on line %d
+
Arg value Array
Warning: posix_getpgid() expects parameter 1 to be long, array given in %s on line %d
diff --git a/ext/posix/tests/posix_getpwuid_variation.phpt b/ext/posix/tests/posix_getpwuid_variation.phpt
index 8e91d6c31..8b66f7f3d 100644
--- a/ext/posix/tests/posix_getpwuid_variation.phpt
+++ b/ext/posix/tests/posix_getpwuid_variation.phpt
@@ -103,26 +103,36 @@ valid output
Arg value 0.5
valid output
+Notice: Array to string conversion in %sposix_getpwuid_variation.php on line %d
+
Arg value Array
Warning: posix_getpwuid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getpwuid_variation.php on line %d
+
Arg value Array
Warning: posix_getpwuid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getpwuid_variation.php on line %d
+
Arg value Array
Warning: posix_getpwuid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getpwuid_variation.php on line %d
+
Arg value Array
Warning: posix_getpwuid() expects parameter 1 to be long, array given in %s on line %d
valid output
+Notice: Array to string conversion in %sposix_getpwuid_variation.php on line %d
+
Arg value Array
Warning: posix_getpwuid() expects parameter 1 to be long, array given in %s on line %d
diff --git a/ext/posix/tests/posix_kill_variation1.phpt b/ext/posix/tests/posix_kill_variation1.phpt
index 6fcf0fa98..230977a9d 100644
--- a/ext/posix/tests/posix_kill_variation1.phpt
+++ b/ext/posix/tests/posix_kill_variation1.phpt
@@ -97,26 +97,36 @@ bool(false)
Arg value 0.5
bool(false)
+Notice: Array to string conversion in %sposix_kill_variation1.php on line %d
+
Arg value Array
Warning: posix_kill() expects parameter 1 to be long, array given in %s on line %d
bool(false)
+Notice: Array to string conversion in %sposix_kill_variation1.php on line %d
+
Arg value Array
Warning: posix_kill() expects parameter 1 to be long, array given in %s on line %d
bool(false)
+Notice: Array to string conversion in %sposix_kill_variation1.php on line %d
+
Arg value Array
Warning: posix_kill() expects parameter 1 to be long, array given in %s on line %d
bool(false)
+Notice: Array to string conversion in %sposix_kill_variation1.php on line %d
+
Arg value Array
Warning: posix_kill() expects parameter 1 to be long, array given in %s on line %d
bool(false)
+Notice: Array to string conversion in %sposix_kill_variation1.php on line %d
+
Arg value Array
Warning: posix_kill() expects parameter 1 to be long, array given in %s on line %d
diff --git a/ext/posix/tests/posix_kill_variation2.phpt b/ext/posix/tests/posix_kill_variation2.phpt
index 240cfa57c..c03ead9a4 100644
--- a/ext/posix/tests/posix_kill_variation2.phpt
+++ b/ext/posix/tests/posix_kill_variation2.phpt
@@ -97,26 +97,36 @@ bool(false)
Arg value 0.5
bool(false)
+Notice: Array to string conversion in %sposix_kill_variation2.php on line %d
+
Arg value Array
Warning: posix_kill() expects parameter 2 to be long, array given in %s on line %d
bool(false)
+Notice: Array to string conversion in %sposix_kill_variation2.php on line %d
+
Arg value Array
Warning: posix_kill() expects parameter 2 to be long, array given in %s on line %d
bool(false)
+Notice: Array to string conversion in %sposix_kill_variation2.php on line %d
+
Arg value Array
Warning: posix_kill() expects parameter 2 to be long, array given in %s on line %d
bool(false)
+Notice: Array to string conversion in %sposix_kill_variation2.php on line %d
+
Arg value Array
Warning: posix_kill() expects parameter 2 to be long, array given in %s on line %d
bool(false)
+Notice: Array to string conversion in %sposix_kill_variation2.php on line %d
+
Arg value Array
Warning: posix_kill() expects parameter 2 to be long, array given in %s on line %d
diff --git a/ext/posix/tests/posix_mkfifo_safemode.phpt b/ext/posix/tests/posix_mkfifo_safemode.phpt
index 6f1f09249..1126c00df 100644
--- a/ext/posix/tests/posix_mkfifo_safemode.phpt
+++ b/ext/posix/tests/posix_mkfifo_safemode.phpt
@@ -17,9 +17,10 @@ if (!extension_loaded('posix')) {
if (posix_geteuid() == 0) {
die('SKIP Cannot run test as root.');
}
+if (PHP_VERSION_ID < 503099) {
+ die('SKIP Safe mode is no longer available.');
+}
?>
---INI--
-safe_mode = 1
--FILE--
<?php
var_dump(posix_mkfifo('/tmp/foobar', 0644));
diff --git a/ext/posix/tests/posix_strerror_variation1.phpt b/ext/posix/tests/posix_strerror_variation1.phpt
index 5d6e35453..4d2b52671 100644
--- a/ext/posix/tests/posix_strerror_variation1.phpt
+++ b/ext/posix/tests/posix_strerror_variation1.phpt
@@ -96,26 +96,36 @@ string
Arg value 0.5
string
+Notice: Array to string conversion in %sposix_strerror_variation1.php on line %d
+
Arg value Array
Warning: posix_strerror() expects parameter 1 to be long, array given in %s on line %d
boolean
+Notice: Array to string conversion in %sposix_strerror_variation1.php on line %d
+
Arg value Array
Warning: posix_strerror() expects parameter 1 to be long, array given in %s on line %d
boolean
+Notice: Array to string conversion in %sposix_strerror_variation1.php on line %d
+
Arg value Array
Warning: posix_strerror() expects parameter 1 to be long, array given in %s on line %d
boolean
+Notice: Array to string conversion in %sposix_strerror_variation1.php on line %d
+
Arg value Array
Warning: posix_strerror() expects parameter 1 to be long, array given in %s on line %d
boolean
+Notice: Array to string conversion in %sposix_strerror_variation1.php on line %d
+
Arg value Array
Warning: posix_strerror() expects parameter 1 to be long, array given in %s on line %d
diff --git a/ext/posix/tests/posix_times_basic.phpt b/ext/posix/tests/posix_times_basic.phpt
index eb8af10df..5da6434b1 100644
--- a/ext/posix/tests/posix_times_basic.phpt
+++ b/ext/posix/tests/posix_times_basic.phpt
@@ -24,14 +24,14 @@ Test posix_times() function : basic functionality
Basic test of POSIX times function
array(5) {
["ticks"]=>
- int(%d)
+ int(%i)
["utime"]=>
- int(%d)
+ int(%i)
["stime"]=>
- int(%d)
+ int(%i)
["cutime"]=>
- int(%d)
+ int(%i)
["cstime"]=>
- int(%d)
+ int(%i)
}
===DONE====