Bug #14247 Updated: Can't list directories in symlink using ftp_nlist and ftp_rawlist
| From: | amiroot at yahoo dot com | Date: | Tue, 27 Nov 2001 06:45:40 +0000 |
| Subject: | Bug #14247 Updated: Can't list directories in symlink using ftp_nlist and ftp_rawlist | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-71740@lists.php.net to get a copy of this message | ||
ID: 14247
User updated by: amiroot@yahoo.com
Reported By: amiroot@yahoo.com
Status: Open
Bug Type: FTP related
Operating System: RedHat 7.1
PHP Version: 4.0.6
New Comment:
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!!
Previous Comments:
------------------------------------------------------------------------
[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