Bug #14247 Updated: Can't list directories in symlink using ftp_nlist and ftp_rawlist
| From: | sniper@php.net | Date: | Thu, 11 Jul 2002 03:16:39 +0000 |
| Subject: | Bug #14247 Updated: Can't list directories in symlink using ftp_nlist and ftp_rawlist | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13801@lists.php.net to get a copy of this message | ||
ID: 14247
Updated by: sniper@php.net
Reported By: amiroot@yahoo.com
-Status: Open
+Status: Closed
Bug Type: FTP related
Operating System: RedHat 7.1
PHP Version: 4.0.6
New Comment:
I can not reproduce this with this snapshot and same ftpd:
http://snaps.php.net/php4-latest.tar.gz
Previous Comments:
------------------------------------------------------------------------
[2001-11-27 01:45:40] amiroot@yahoo.com
Some addition information missed in the last mail.
In my original programme, I'd tried to chdir and then list teh
directories. The chdir can successfully ran but the is failed nomatter
how I change the code.
The files in my test directories.
# cd public
# ls -l
total 92
-rw-r--r-- 1 mylogin webadmin 1145 Oct 5 17:32 db_test.php
-rw-r--r-- 1 mylogin webadmin 19978 Nov 27 11:36 ftp2.php
-rw-r--r-- 1 mylogin webadmin 11503 Nov 27 11:32 ftptest.php
-rw-r--r-- 1 mylogin webadmin 42496 Nov 27 10:49 md5.exe
drwxr-xr-x 2 mylogin webadmin 4096 Oct 5 17:32 midi
drwxr-xr-x 2 mylogin webadmin 4096 Nov 27 10:33 test
-rw-r--r-- 1 mylogin webadmin 276 Nov 27 11:51 test.php
Thx a lot!!
------------------------------------------------------------------------
[2001-11-27 01:32:21] amiroot@yahoo.com
hihi all,
I'm using RedHat 7.1, kernel 2.9.6 with apache 1.3.19, php4.0.6 and
wu-ftpd-2.6.1-18. I did using ftp_nlist and ftp_rawlist to list a
symlink directories in my programme. For ftp_nlist, it can only list
the files in the directorise. For ftp_rawlist, it only shows the
direcctories itself (not . but the name of itself). I tested with the
following simple script and the problem still exists.
<?php
$conn = ftp_connect("localhost");
if (!conn) exit();
if (!ftp_login($conn, 'mylogin', 'password')) exit();
ftp_pasv($conn, TRUE);
$ls = ftp_nlist($conn, 'public');
$rls = ftp_rawlist($conn, 'public');
var_dump($ls);
var_dump($rls);
?>
The result of my programme is that: for $ls, it shows all files execpt
directories; for $rls it shows only the directories with it's
information.
For the normally directories and the symlink files, it is OK!!
In my original programme, however, even thorugh I can't see any
directories, I can still mkdir and it return success. However, I can't
see the new directory. I'd also tried this test programme in FreeBSD4.4
and php4.0.6, connecting to the same FTP server, getting the same
result.
Here is some additional information for your reference:
make a link:
ln -s ./public_html ./public
test programme result (2 directories missed) :
array(5) { [0]=> string(18) "public/db_test.php" [1]=> string(15)
"public/ftp2.php" [2]=> string(18) "public/ftptest.php" [3]=>
string(14) "public/md5.exe" [4]=> string(15) "public/test.php" }
array(1) { [0]=> string(76) "lrwxrwxrwx 1 root root 11 Nov 26 11:01
public -> public_html" }
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=14247&edit=1