// attempts to open data stream for non-existent directories

Bug #72667 opendir() with ftp:// attempts to open data stream for non-existent directories
Submitted: 2016-07-25 10:21 UTC Modified: 2016-07-25 11:38 UTC
From: vhu at iki dot fi Assigned:
Status: Closed Package: Directory function related
PHP Version: 7.1Git-2016-07-25 (Git) OS: all
Private report: No CVE-ID: None

 [2016-07-25 10:21 UTC] vhu at iki dot fi

Description:
------------
opendir() attempts to open FTP data stream for non-existent directories when used with ftp:// wrapper.

Test script:
---------------
var_dump(opendir("ftp://example.com/nonexistent"));
var_dump(opendir("ftp://example.com/"));


Expected result:
----------------
Warning: opendir(ftp://example.com/nonexistent): failed to open dir: FTP server reports 250 The system cannot find the file specified. 
 in test.php on line 2
bool(false)
resource(8) of type (stream)

Actual result:
--------------
 PHP Warning:  opendir(): connect() failed: Connection timed out in test.php on line 2
PHP Warning:  opendir(ftp://example.com/nonexistent): failed to open dir: FTP server reports 200 Type set to A.
 in test.php on line 2
bool(false)
resource(9) of type (stream)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2016-07-25 11:38 UTC] vhu at iki dot fi

-Summary: opendir() attempts to open FTP data stream for non-existent directories +Summary: opendir() with ftp:// attempts to open data stream for non-existent directories

 [2016-07-25 11:38 UTC] vhu at iki dot fi

Clarified summary.

 [2016-07-27 14:01 UTC] nikic@php.net

-Status: Open +Status: Closed