version 1.1.1.1, 2012/02/21 23:48:00
|
version 1.1.1.4, 2014/06/15 20:03:54
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2014 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 310 const zend_function_entry posix_functions[] = {
|
Line 310 const zend_function_entry posix_functions[] = {
|
static PHP_MINFO_FUNCTION(posix) |
static PHP_MINFO_FUNCTION(posix) |
{ |
{ |
php_info_print_table_start(); |
php_info_print_table_start(); |
php_info_print_table_row(2, "Revision", "$Revision$"); | php_info_print_table_row(2, "Revision", "$Id$"); |
php_info_print_table_end(); |
php_info_print_table_end(); |
} |
} |
/* }}} */ |
/* }}} */ |
Line 838 PHP_FUNCTION(posix_mkfifo)
|
Line 838 PHP_FUNCTION(posix_mkfifo)
|
long mode; |
long mode; |
int result; |
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; |
RETURN_FALSE; |
} |
} |
|
|
if (strlen(path) != path_len) { | if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) { |
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
|
if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) || |
|
(PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR)))) { |
|
RETURN_FALSE; |
|
} |
|
|
|
result = mkfifo(path, mode); |
result = mkfifo(path, mode); |
if (result < 0) { |
if (result < 0) { |
POSIX_G(last_error) = errno; |
POSIX_G(last_error) = errno; |
Line 876 PHP_FUNCTION(posix_mknod)
|
Line 871 PHP_FUNCTION(posix_mknod)
|
|
|
php_dev = 0; |
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) { |
&mode, &major, &minor) == FAILURE) { |
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
|
if (strlen(path) != path_len) { | if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) { |
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
|
if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) || |
|
(PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR)))) { |
|
RETURN_FALSE; |
|
} |
|
|
|
if ((mode & S_IFCHR) || (mode & S_IFBLK)) { |
if ((mode & S_IFCHR) || (mode & S_IFBLK)) { |
if (ZEND_NUM_ARGS() == 2) { |
if (ZEND_NUM_ARGS() == 2) { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "For S_IFCHR and S_IFBLK you need to pass a major device kernel identifier"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "For S_IFCHR and S_IFBLK you need to pass a major device kernel identifier"); |
Line 961 PHP_FUNCTION(posix_access)
|
Line 951 PHP_FUNCTION(posix_access)
|
int filename_len, ret; |
int filename_len, ret; |
char *filename, *path; |
char *filename, *path; |
|
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &mode) == FAILURE) { | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &mode) == FAILURE) { |
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
|
if (strlen(filename) != filename_len) { |
|
RETURN_FALSE; |
|
} |
|
|
|
path = expand_filepath(filename, NULL TSRMLS_CC); |
path = expand_filepath(filename, NULL TSRMLS_CC); |
if (!path) { |
if (!path) { |
POSIX_G(last_error) = EIO; |
POSIX_G(last_error) = EIO; |
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
|
if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) || | 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)))) { | |
efree(path); |
efree(path); |
POSIX_G(last_error) = EPERM; |
POSIX_G(last_error) = EPERM; |
RETURN_FALSE; |
RETURN_FALSE; |