|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-07-25 08:48 UTC] michael202 at gmx dot de
Description: ------------ calling is_dir() with an UNC path truncates each part of the path. The last character is missing. This results in unnecessary errors (on the host side) and slowdowns (on client side). Reproduce code: --------------- windows only (php 5.2.3, Windows XP with cmd.exe) and linux host. <?php $p = '\\hostA\volumeB\dirC'; echo(is_dir($p) . "\n"); and then trace network IO for service/port SMB. Beware of posssible side effects though caching of SMB connections Expected result: ---------------- no error messages in /var/log/messages on 'hostA' Actual result: -------------- I traced these SMB Commands sent over the network: Connect AndX Request \\hostA\IPC$ Connect AndX Request \\hostA\volume -> STATUS_BAD_NETWORK_NAME FindFirst2, Pattern: \dir these are in /var/log/messages in 'hostA' ... smbd/service.c:make_connection(252) ... couldn't find service volume I think this is another problem with tsrm_virtual_cwd.c where around line 500 state_cwd_length is set to 2 if a slash is found at the beginning. Perhaps the existence of UNC paths is not checked for. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
To help you isolate the problem, a sample code snippet producing the SMB trouble: $filename="test.dat"; $dataFile = fopen( $filename, "r" ) ; if($dataFile) { while (!feof($dataFile)) { $buffer = fgets($dataFile, 4096); } fclose($dataFile); } else { die( "fopen failed for $filename" ) ; } /*(to be executed from smb share!)*/