Bug #54431 [NEW]: opendir() does not work with ftps:// wrapper

From: Date: Thu, 31 Mar 2011 11:48:48 +0000
Subject: Bug #54431 [NEW]: opendir() does not work with ftps:// wrapper
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-159871@lists.php.net to get a copy of this message
From:             
Operating system: Windows XP & 2003 R2
PHP version:      5.2.17
Package:          Directory function related
Bug Type:         Bug
Bug description:opendir() does not work with ftps:// wrapper

Description:
------------
opendir() triggers 2 warnings when used with ftps:// wrapper URLs and
fails.

fopen() works with files contained within the directory I am trying to
open.

If opendir() is not designed to work with ftps://, I would request this as
a feature (since ftp_ssl_open() does not work in standard Windows builds).

Test script:
---------------
<?php

  // This works
  $fp = fopen("ftps://$user:$pass@$host:$port/$file");
  while ($part = fread($fp,1024)) $filedata .= $part;
  fclose($fp);
  print("Downloaded file:\n$filedata");

  // This doesn't work, triggers 2 warnings
  print("\n\nDirectory listing:\n");
  $dp = opendir("ftps://$user:$pass@$host:$port/");
  while ($file = readdir($dp)) print("$file\n");
  closedir($dp);

?>

Expected result:
----------------
Downloaded file:
<contents of file>

Directory listing:
<list of files>

Actual result:
--------------
Downloaded file:
<contents of file>

Directory listing:
Warning: opendir(): SSL/TLS already set-up for this stream in <script path>
on line 11
Warning: opendir(ftps://...@host:port/): failed to open dir: Unable to
activate SSL mode in <script path> on line 11

-- 
Edit bug report at http://bugs.php.net/bug.php?id=54431&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=54431&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=54431&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=54431&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=54431&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54431&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=54431&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=54431&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=54431&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=54431&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=54431&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=54431&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=54431&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=54431&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=54431&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54431&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54431&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=54431&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=54431&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=54431&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=54431&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=54431&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#159871) next »