]> granicus.if.org Git - php/commitdiff
fix test : do not run when run as root
authorRaghubansh Kumar <kraghuba@php.net>
Tue, 25 Dec 2007 16:15:34 +0000 (16:15 +0000)
committerRaghubansh Kumar <kraghuba@php.net>
Tue, 25 Dec 2007 16:15:34 +0000 (16:15 +0000)
ext/standard/tests/dir/dir_variation3.phpt
ext/standard/tests/dir/dir_variation7.phpt

index a3badc79aab2279e0c9fdf66515822ed8a0650f3..f8d325874ea4d993b95882bb70e260454acbf57f 100644 (file)
@@ -5,6 +5,15 @@ Test dir() function : usage variations - different directory permissions
 if( substr(PHP_OS, 0, 3) == 'WIN') {
   die('skip Not for Windows');
 }
+// Skip if being run by root (files are always readable, writeable and executable)
+$filename = dirname(__FILE__)."/dir_root_check.tmp";
+$fp = fopen($filename, 'w');
+fclose($fp);
+if(fileowner($filename) == 0) {
+        unlink ($filename);
+        die('skip...cannot be run as root\n');
+}
+unlink($filename);
 ?>
 --FILE--
 <?php
index baf9a79b546631455d4f632646543b723ac7ff0c..bb10e607a38aaf314e36913d07f9695f0fb69599 100644 (file)
@@ -5,6 +5,15 @@ Test dir() function : usage variations - directories with restricted permissions
 if( substr(PHP_OS, 0, 3) == 'WIN') {
   die('skip Not for Windows');
 }
+// Skip if being run by root (files are always readable, writeable and executable)
+$filename = dirname(__FILE__)."/dir_root_check.tmp";
+$fp = fopen($filename, 'w');
+fclose($fp);
+if(fileowner($filename) == 0) {
+        unlink ($filename);
+        die('skip...cannot be run as root\n');
+}
+unlink($filename);
 ?>
 --FILE--
 <?php