From: Zoe Slattery Date: Thu, 14 Jun 2007 16:15:50 +0000 (+0000) Subject: Tests are not valid if run by root - adding check to skip is user is root. X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~458 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=affcaa4cb5d0694b41cbb9573830abd14a9808c9;p=php Tests are not valid if run by root - adding check to skip is user is root. --- diff --git a/ext/standard/tests/file/is_executable_basic.phpt b/ext/standard/tests/file/is_executable_basic.phpt index 9141a4af09..64f140edff 100644 --- a/ext/standard/tests/file/is_executable_basic.phpt +++ b/ext/standard/tests/file/is_executable_basic.phpt @@ -5,6 +5,16 @@ Test is_executable() function: basic functionality if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. only for LINUX'); } +// Skip if being run by root (files are always readable, writeable and executable) +$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\n'); +} + +unlink($filename); ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE--