mirror of
https://github.com/php/php-src.git
synced 2026-03-26 09:12:14 +01:00
added skipif for root
This commit is contained in:
@@ -5,6 +5,17 @@ Test is_executable() function: usage variations - file/dir with diff. perms
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip not for windows');
|
||||
}
|
||||
// Skip if being run by root
|
||||
$filename = dirname(__FILE__)."/is_readable_root_check.tmp";
|
||||
$fp = fopen($filename, 'w');
|
||||
fclose($fp);
|
||||
if(fileowner($filename) == 0) {
|
||||
unlink ($filename);
|
||||
die('skip cannot be run as root');
|
||||
}
|
||||
|
||||
unlink($filename);
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -5,6 +5,17 @@ Test is_readable() function: usage variations - file/dir with diff. perms
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip not for windows');
|
||||
}
|
||||
// Skip if being run by root
|
||||
$filename = dirname(__FILE__)."/is_readable_root_check.tmp";
|
||||
$fp = fopen($filename, 'w');
|
||||
fclose($fp);
|
||||
if(fileowner($filename) == 0) {
|
||||
unlink ($filename);
|
||||
die('skip cannot be run as root');
|
||||
}
|
||||
|
||||
unlink($filename);
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -5,6 +5,17 @@ Test is_writable() and its alias is_writeable() function: usage variations - fil
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only on LINUX');
|
||||
}
|
||||
// Skip if being run by root
|
||||
$filename = dirname(__FILE__)."/is_readable_root_check.tmp";
|
||||
$fp = fopen($filename, 'w');
|
||||
fclose($fp);
|
||||
if(fileowner($filename) == 0) {
|
||||
unlink ($filename);
|
||||
die('skip cannot be run as root');
|
||||
}
|
||||
|
||||
unlink($filename);
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -4,6 +4,17 @@ Test lchown() function : error functionality
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') die('skip no windows support');
|
||||
if (!function_exists("posix_getuid")) die("skip no posix_getuid()");
|
||||
// Skip if being run by root
|
||||
$filename = dirname(__FILE__)."/is_readable_root_check.tmp";
|
||||
$fp = fopen($filename, 'w');
|
||||
fclose($fp);
|
||||
if(fileowner($filename) == 0) {
|
||||
unlink ($filename);
|
||||
die('skip cannot be run as root');
|
||||
}
|
||||
|
||||
unlink($filename);
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -5,6 +5,17 @@ Test tempnam() function: usage variations - permissions(0000 to 0777) of dir
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip Not valid for Windows');
|
||||
}
|
||||
// Skip if being run by root
|
||||
$filename = dirname(__FILE__)."/is_readable_root_check.tmp";
|
||||
$fp = fopen($filename, 'w');
|
||||
fclose($fp);
|
||||
if(fileowner($filename) == 0) {
|
||||
unlink ($filename);
|
||||
die('skip cannot be run as root');
|
||||
}
|
||||
|
||||
unlink($filename);
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user