From ec3ee30a75e4e65e876cfeb322003bbd84b103db Mon Sep 17 00:00:00 2001 From: Zoe Slattery Date: Fri, 20 Mar 2009 09:09:34 +0000 Subject: [PATCH] added skipif for root --- ext/standard/tests/file/is_executable_variation2.phpt | 11 +++++++++++ ext/standard/tests/file/is_readable_variation2.phpt | 11 +++++++++++ ext/standard/tests/file/is_writable_variation2.phpt | 11 +++++++++++ ext/standard/tests/file/lchown_error.phpt | 11 +++++++++++ ext/standard/tests/file/tempnam_variation4.phpt | 11 +++++++++++ 5 files changed, 55 insertions(+) diff --git a/ext/standard/tests/file/is_executable_variation2.phpt b/ext/standard/tests/file/is_executable_variation2.phpt index 8deba2b65b..d6c683b776 100644 --- a/ext/standard/tests/file/is_executable_variation2.phpt +++ b/ext/standard/tests/file/is_executable_variation2.phpt @@ -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-- --FILE-- --FILE-- --FILE-- --FILE--