mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
added skipif for root
This commit is contained in:
parent
92f17edda7
commit
ec3ee30a75
5 changed files with 55 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue