Description:
------------
Hi,
I am connecting to a Solaris file server and running a readdir (see the test script for more information).
The script iterates through everything in the folder, and then on the last iteration, where readdir() should return false, it just hangs. The process is killable via ctrl-C but it never completes that loop. The folder in question has a few hundred files, but other systems are able to list the files in that folder without a problem. I've tried two different PHP clients: FreeBSD (PHP 5.3.10) clients and CentOS (5.1.6) and both behave the same way. Other SFTP applications do not seem to have this problem. For example, if I connect using the FreeBSD SFTP command-line client, it works as expected.
Test script:
---------------
$folder = opendir("ssh2.sftp://" . $sftp . $folder_name);
if (!$folder) {
echo "ERROR: Could not list folder contents on " . $server_name . "!\n";
exit(1);
}
while (($file_name = readdir($folder)) !== false) {
echo $file_name . "\n";
}
Expected result:
----------------
It should print out a list of the files in the remote folder.
Actual result:
--------------
The script hangs on what should be the last readdir().

Patches

Pull Requests

History

I sent tjg an email on how to proceed to solve this bug, as I don't have a
Solaris server to debug this.

[2012-06-18 15:33 UTC] tjg at soe dot ucsc dot edu

I am very sorry that I didn't resolve this ticket earlier. I actually totally forgot about it. Patching SunOS actually appears to have fixed this problem, so my guess is that it was a problem with their SSH server and not the PECL module. Sorry about not reporting that sooner! :\