[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746_2.phpt branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746_3.phpt trunk/ext/standard/tests/file
pajoye Sat, 30 Jan 2010 21:24:04 + Revision: http://svn.php.net/viewvc?view=revision&revision=294261 Log: - fix skip clauses Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746_2.phpt U php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746_3.phpt U php/php-src/trunk/ext/standard/tests/file/windows_links/bug48746_2.phpt U php/php-src/trunk/ext/standard/tests/file/windows_links/bug48746_3.phpt Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746_2.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746_2.phpt 2010-01-30 21:12:20 UTC (rev 294260) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746_2.phpt 2010-01-30 21:24:04 UTC (rev 294261) @@ -9,11 +9,11 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) { die('skip windows only test'); } -$cmd = "mklink.exe /?"; -$ret = @exec($cmd, $output, $return_val); -if (count($output) == 0) { -die("mklink.exe not found in PATH"); +$ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out); +if (strpos($ret, 'privilege')) { + die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); } +unlink('mklink bug48746_tmp.lnk'); ?> --FILE-- &1', $out); +if (strpos($out[0], 'recognized')) { + die('skip. junction.exe not found in PATH.'); } + ?> --FILE-- &1', $out); +if (strpos($ret, 'privilege')) { + die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); } +unlink('mklink bug48746_tmp.lnk'); ?> --FILE-- .. [2] => a.php [3] => b.php -) +) Modified: php/php-src/trunk/ext/standard/tests/file/windows_links/bug48746_3.phpt === --- php/php-src/trunk/ext/standard/tests/file/windows_links/bug48746_3.phpt 2010-01-30 21:12:20 UTC (rev 294260) +++ php/php-src/trunk/ext/standard/tests/file/windows_links/bug48746_3.phpt 2010-01-30 21:24:04 UTC (rev 294261) @@ -7,13 +7,13 @@ --SKIPIF-- &1', $out); +if (strpos($out[0], 'recognized')) { + die('skip. junction.exe not found in PATH.'); } + ?> --FILE-- .. [2] => a.php [3] => b.php -) +) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746.phpt trunk/ext/standard/tests/file/windows_links/bug48746.phpt
pajoye Sat, 30 Jan 2010 21:12:20 + Revision: http://svn.php.net/viewvc?view=revision&revision=294260 Log: - fix test init Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746.phpt U php/php-src/trunk/ext/standard/tests/file/windows_links/bug48746.phpt Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746.phpt 2010-01-30 20:55:01 UTC (rev 294259) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_links/bug48746.phpt 2010-01-30 21:12:20 UTC (rev 294260) @@ -19,7 +19,7 @@ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/TSRM/tsrm_win32.c trunk/TSRM/tsrm_win32.c trunk/ext/standard/tests/file/windows_acls/bug44859.phpt trunk/ext/standard/tests/file/windows_acls/bug44859_2.p
pajoye Sat, 30 Jan 2010 20:55:01 + Revision: http://svn.php.net/viewvc?view=revision&revision=294259 Log: - fix write access check when write mode only is requested (not RW) Changed paths: U php/php-src/branches/PHP_5_3/TSRM/tsrm_win32.c U php/php-src/trunk/TSRM/tsrm_win32.c U php/php-src/trunk/ext/standard/tests/file/windows_acls/bug44859.phpt U php/php-src/trunk/ext/standard/tests/file/windows_acls/bug44859_2.phpt A php/php-src/trunk/ext/standard/tests/file/windows_acls/bug44859_4.phpt Modified: php/php-src/branches/PHP_5_3/TSRM/tsrm_win32.c === --- php/php-src/branches/PHP_5_3/TSRM/tsrm_win32.c 2010-01-30 20:44:57 UTC (rev 294258) +++ php/php-src/branches/PHP_5_3/TSRM/tsrm_win32.c 2010-01-30 20:55:01 UTC (rev 294259) @@ -303,7 +303,7 @@ fAccess = bucket->is_writable; goto Finished; } - desired_access = FILE_GENERIC_READ | FILE_GENERIC_WRITE; + desired_access = FILE_GENERIC_WRITE; } else if(mode <= 4) { if(bucket != NULL && bucket->is_rvalid) { fAccess = bucket->is_readable; @@ -348,6 +348,11 @@ else if(desired_access == FILE_GENERIC_WRITE) { bucket->is_wvalid = 1; bucket->is_writable = fAccess; + } else if (desired_access == FILE_GENERIC_READ | FILE_GENERIC_WRITE) { + bucket->is_rvalid = 1; + bucket->is_readable = fAccess; + bucket->is_wvalid = 1; + bucket->is_writable = fAccess; } } Modified: php/php-src/trunk/TSRM/tsrm_win32.c === --- php/php-src/trunk/TSRM/tsrm_win32.c 2010-01-30 20:44:57 UTC (rev 294258) +++ php/php-src/trunk/TSRM/tsrm_win32.c 2010-01-30 20:55:01 UTC (rev 294259) @@ -303,7 +303,7 @@ fAccess = bucket->is_writable; goto Finished; } - desired_access = FILE_GENERIC_READ | FILE_GENERIC_WRITE; + desired_access = FILE_GENERIC_WRITE; } else if(mode <= 4) { if(bucket != NULL && bucket->is_rvalid) { fAccess = bucket->is_readable; @@ -348,6 +348,11 @@ else if(desired_access == FILE_GENERIC_WRITE) { bucket->is_wvalid = 1; bucket->is_writable = fAccess; + } else if (desired_access == FILE_GENERIC_READ | FILE_GENERIC_WRITE) { + bucket->is_rvalid = 1; + bucket->is_readable = fAccess; + bucket->is_wvalid = 1; + bucket->is_writable = fAccess; } } Modified: php/php-src/trunk/ext/standard/tests/file/windows_acls/bug44859.phpt === --- php/php-src/trunk/ext/standard/tests/file/windows_acls/bug44859.phpt 2010-01-30 20:44:57 UTC (rev 294258) +++ php/php-src/trunk/ext/standard/tests/file/windows_acls/bug44859.phpt 2010-01-30 20:55:01 UTC (rev 294259) @@ -21,6 +21,7 @@ $path = __DIR__ . '/a.txt'; foreach ($iteration as $perms => $exp) { create_file($path, $perms); + clearstatcache(true, $path); echo 'Iteration #' . $i++ . ': '; if (is_writable($path) == $exp) { echo "passed.\n"; @@ -36,6 +37,7 @@ $i = 1; foreach ($iteration as $perms => $exp) { create_file($path, $perms); + clearstatcache(true, $path); echo 'Iteration #' . $i++ . ': '; if (is_writable($path) == $exp) { echo "passed.\n"; Modified: php/php-src/trunk/ext/standard/tests/file/windows_acls/bug44859_2.phpt === --- php/php-src/trunk/ext/standard/tests/file/windows_acls/bug44859_2.phpt 2010-01-30 20:44:57 UTC (rev 294258) +++ php/php-src/trunk/ext/standard/tests/file/windows_acls/bug44859_2.phpt 2010-01-30 20:55:01 UTC (rev 294259) @@ -21,11 +21,12 @@ $path = __DIR__ . '/a.txt'; foreach ($iteration as $perms => $exp) { create_file($path, $perms); + clearstatcache(true, $path); echo 'Iteration #' . $i++ . ': '; if (is_readable($path) == $exp) { echo "passed.\n"; } else { - var_dump(is_writable($path), $exp); + var_dump(is_readable($path), $exp); echo "failed.\n
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/tests/file/windows_acls/common.inc trunk/ext/standard/tests/file/windows_acls/common.inc
pajoye Sat, 30 Jan 2010 20:21:16 + Revision: http://svn.php.net/viewvc?view=revision&revision=294255 Log: - cleanup & correct msg Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_acls/common.inc U php/php-src/trunk/ext/standard/tests/file/windows_acls/common.inc Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_acls/common.inc === --- php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_acls/common.inc 2010-01-30 20:19:33 UTC (rev 294254) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/file/windows_acls/common.inc 2010-01-30 20:21:16 UTC (rev 294255) @@ -118,7 +118,7 @@ function create_file($name, $perms) { if (empty($name)) { - echo "create_dir: Empty name is not allowed\n"; + echo "create_file: Empty name is not allowed\n"; return; } Modified: php/php-src/trunk/ext/standard/tests/file/windows_acls/common.inc === --- php/php-src/trunk/ext/standard/tests/file/windows_acls/common.inc 2010-01-30 20:19:33 UTC (rev 294254) +++ php/php-src/trunk/ext/standard/tests/file/windows_acls/common.inc 2010-01-30 20:21:16 UTC (rev 294255) @@ -118,12 +118,11 @@ function create_file($name, $perms) { if (empty($name)) { - echo "create_dir: Empty name is not allowed\n"; + echo "create_file: Empty name is not allowed\n"; return; } touch($name); - $dst = realpath($name); icacls_set($name, PHPT_ACL_GRANT, $perms); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/tests/file/userstreams_003.phpt trunk/ext/standard/tests/file/userstreams_003.phpt
pajoye Sat, 30 Jan 2010 20:14:36 + Revision: http://svn.php.net/viewvc?view=revision&revision=294253 Log: - this value is platform dependent (unix too) Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/tests/file/userstreams_003.phpt U php/php-src/trunk/ext/standard/tests/file/userstreams_003.phpt Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/file/userstreams_003.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/file/userstreams_003.phpt 2010-01-30 17:56:00 UTC (rev 294252) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/file/userstreams_003.phpt 2010-01-30 20:14:36 UTC (rev 294253) @@ -101,7 +101,7 @@ value: int(0) ptrparam: -int(8192) +int(%d) $option === 3 === 3: bool(true) $value === 0 === 0: Modified: php/php-src/trunk/ext/standard/tests/file/userstreams_003.phpt === --- php/php-src/trunk/ext/standard/tests/file/userstreams_003.phpt 2010-01-30 17:56:00 UTC (rev 294252) +++ php/php-src/trunk/ext/standard/tests/file/userstreams_003.phpt 2010-01-30 20:14:36 UTC (rev 294253) @@ -101,7 +101,7 @@ value: int(0) ptrparam: -int(8192) +int(%d) $option === 3 === 3: bool(true) $value === 0 === 0: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/tests/file/tempnam_variation7-win32.phpt trunk/ext/standard/tests/file/tempnam_variation7-win32.phpt
pajoye Sat, 30 Jan 2010 17:56:00 + Revision: http://svn.php.net/viewvc?view=revision&revision=294252 Log: - cs Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/tests/file/tempnam_variation7-win32.phpt U php/php-src/trunk/ext/standard/tests/file/tempnam_variation7-win32.phpt Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/file/tempnam_variation7-win32.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/file/tempnam_variation7-win32.phpt 2010-01-30 17:06:06 UTC (rev 294251) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/file/tempnam_variation7-win32.phpt 2010-01-30 17:56:00 UTC (rev 294252) @@ -17,50 +17,47 @@ echo "*** Testing tempnam() with invalid/non-existing directory names ***\n"; /* An array of names, which will be passed as a dir name */ $names_arr = array( - /* Invalid args */ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - array(), + /* Invalid args */ + -1, + TRUE, + FALSE, + NULL, + "", + " ", + "\0", + array(), - /* Non-existing dirs */ - "/no/such/file/dir", - "php" - + /* Non-existing dirs */ + "/no/such/file/dir", + "php" ); for( $i=0; $i "; -print($file_name); -echo "\n"; + echo "File name is => "; + print($file_name); + echo "\n"; -echo "File permissions are => "; -printf("%o", fileperms($file_name) ); -echo "\n"; - -echo "File created in => "; -$file_dir = dirname($file_name); -if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; -} -else { - echo "unknown location\n"; -} - } - else { -echo "-- File is not created --\n"; - } - - unlink($file_name); + echo "File permissions are => "; + printf("%o", fileperms($file_name) ); + echo "\n"; + + echo "File created in => "; + $file_dir = dirname($file_name); + if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { + echo "temp dir\n"; + } else { + echo "unknown location\n"; + } + } else { + echo "-- File is not created --\n"; + } + + unlink($file_name); } echo "\n*** Done ***\n"; Modified: php/php-src/trunk/ext/standard/tests/file/tempnam_variation7-win32.phpt === --- php/php-src/trunk/ext/standard/tests/file/tempnam_variation7-win32.phpt 2010-01-30 17:06:06 UTC (rev 294251) +++ php/php-src/trunk/ext/standard/tests/file/tempnam_variation7-win32.phpt 2010-01-30 17:56:00 UTC (rev 294252) @@ -17,50 +17,47 @@ echo "*** Testing tempnam() with invalid/non-existing directory names ***\n"; /* An array of names, which will be passed as a dir name */ $names_arr = array( - /* Invalid args */ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - array(), + /* Invalid args */ + -1, + TRUE, + FALSE, + NULL, + "", + " ", + "\0", + array(), - /* Non-existing dirs */ - "/no/such/file/dir", - "php" - + /* Non-existing dirs */ + "/no/such/file/dir", + "php" ); for( $i=0; $i "; -print($file_name); -echo "\n"; + echo "File name is => "; + print($file_name); + echo "\n"; -echo "File permissions are => "; -printf("%o", fileperms($file_name) ); -echo "\n"; - -echo "File created in => "; -$file_dir = dirname($file_name); -if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; -} -else { - echo "unknown location\n"; -} - } - else { -echo "-- File is not created --\n"; - } - - unlink($file_name); + echo "File permissions are => "; + printf("%o", fileperms($file_name) ); + echo "\n"; + + echo "File created in => "; + $file_dir = dirname($file_name); + if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { + echo "temp dir\n"; + } else { + echo "unknown location\n"; + } + } else { + echo "-- File is not created --\n"; + } + + unlink($file_name); } echo "\n*** Done ***\n"; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/tests/file/tempnam_variation3-win32.phpt trunk/ext/standard/tests/file/tempnam_variation3-win32.phpt
pajoye Sat, 30 Jan 2010 17:06:06 + Revision: http://svn.php.net/viewvc?view=revision&revision=294251 Log: - fix test, rewrite it (same cases are tested), CS, simplify, be verbose on error not otherwise (avoid infinite loop in pcre_match inside run-test) Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/tests/file/tempnam_variation3-win32.phpt U php/php-src/trunk/ext/standard/tests/file/tempnam_variation3-win32.phpt Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/file/tempnam_variation3-win32.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/file/tempnam_variation3-win32.phpt 2010-01-30 16:44:46 UTC (rev 294250) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/file/tempnam_variation3-win32.phpt 2010-01-30 17:06:06 UTC (rev 294251) @@ -15,106 +15,100 @@ echo "*** Testing tempnam() with obscure prefixes ***\n"; $file_path = dirname(__FILE__)."/tempnamVar3"; -mkdir($file_path); +if (!mkdir($file_path)) { + echo "Failed, cannot create temp dir $filepath\n"; + exit(1); +} +$file_path = realpath($file_path); + /* An array of prefixes */ $names_arr = array( - /* Invalid args */ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - array(), + /* Valid args (casting)*/ + -1, + TRUE, + FALSE, + NULL, + "", + " ", + "\0", + /* Invalid args */ + array(), - /* prefix with path separator of a non existing directory*/ - "/no/such/file/dir", - "php/php" + /* Valid args*/ + /* prefix with path separator of a non existing directory*/ + "/no/such/file/dir", + "php/php" +); +$res_arr = array( + /* Invalid args */ + true, + true, + true, + true, + true, + true, + true, + false, + + /* prefix with path separator of a non existing directory*/ + true, + true ); for( $i=0; $i "; -print($file_name); -echo "\n"; + /* creating the files in existing dir */ + if (file_exists($file_name) && !$res_arr[$i]) { + echo "Failed\n"; + } + if ($res_arr[$i]) { + $file_dir = dirname($file_name); + if (realpath($file_dir) == $file_path || realpath($file_dir . "\\") == $file_path) { + echo "OK\n"; + } else { + echo "Failed, not created in the correct directory" . realpath($file_dir) . ' vs ' . $file_path ."\n"; + } + + if (!is_writable($file_name)) { + printf("%o\n", fileperms($file_name) ); -echo "File permissions are => "; -printf("%o", fileperms($file_name) ); -echo "\n"; - -echo "File created in => "; -$file_dir = dirname($file_name); -if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; -} -else if (realpath($file_dir) == realpath($file_path) || realpath($file_dir."\\") == realpath($file_path)) { - echo "directory specified\n"; -} -else { - echo "unknown location\n"; -} - } - else { -echo "-- File is not created --\n"; - } - - unlink($file_name); + } + } else { + echo "OK\n"; + } + @unlink($file_name); } rmdir($file_path); -echo "\n*** Done ***\n"; +echo "\n*** Done. ***\n"; ?> --EXPECTF-- *** Testing tempnam() with obscure prefixes *** -- Iteration 0 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 1 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 2 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 3 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 4 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 5 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 6 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 7 -- -Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d --- File is not created -- - -Warning: unlink(): No such file or directory in %s on line %d +Warning: tempnam() expects parameter 2 to be string, array given in %s\ext\standard\tests\file\tempnam_variation3-win32.php on line %d +OK -- Iteration 8 -- -File name is => %s\di%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 9 -- -File name is => %s\ph%s -File permissions are => 100666 -File created in => directory specified +OK -*** Done *** - +*** Done. *** Modified: php/php-src/trunk/ext/standard/tests/file/tempnam_variation3-win32.phpt === --- php/php-src/trunk/ext/standard/tests/file/tempnam_variation3-win32.phpt 2010-01-30 16:44:46 UTC (rev 294250) +++ php/php-src/trunk/ext/standard/tests/file/tempnam_variation3-win32.phpt 2010-01-30 17: