]> granicus.if.org Git - php/commitdiff
added skipif for root
authorZoe Slattery <zoe@php.net>
Fri, 20 Mar 2009 09:09:34 +0000 (09:09 +0000)
committerZoe Slattery <zoe@php.net>
Fri, 20 Mar 2009 09:09:34 +0000 (09:09 +0000)
ext/standard/tests/file/is_executable_variation2.phpt
ext/standard/tests/file/is_readable_variation2.phpt
ext/standard/tests/file/is_writable_variation2.phpt
ext/standard/tests/file/lchown_error.phpt
ext/standard/tests/file/tempnam_variation4.phpt

index 8deba2b65b5cbaa46e8ae7bbb07a5f992477dc94..d6c683b77641f26f063e2c5d401b2628e48309e9 100644 (file)
@@ -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
index 42a82e74cddcec97ad0010238007e6b45d4be6b5..fd83f03ab9e81fdcc17bb55746de79760329bad0 100644 (file)
@@ -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
index f4f42d82e61fc16b6db9d9d62db5a6ea8093c930..4509c068107a35cd8341f6bdf00b43add16a3b5d 100644 (file)
@@ -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
index cddfc7de0ddcbd22b4b703bb3b16b5dbb4be4709..d08c94748b53662173ed3cb5d4fb050caf1f8c42 100644 (file)
@@ -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
index 5525b584a9d9ca7627dff5a0f26e7d79596b086c..f67a7d8cdc0fa58328c1539f1b4edb189af79c9a 100644 (file)
@@ -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