php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41779 ftp_nlist() and ftp_rawlist() fail with open_basedir
Submitted: 2007-06-22 14:18 UTC Modified: 2007-07-14 01:00 UTC
Votes:7
Avg. Score:4.7 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:1 (16.7%)
From: derernst at gmx dot ch Assigned:
Status: No Feedback Package: Safe Mode/open_basedir
PHP Version: 5.2.3 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: derernst at gmx dot ch
New email:
PHP Version: OS:

 

 [2007-06-22 14:18 UTC] derernst at gmx dot ch
Description:
------------
After my ISP upgraded to PHP 5.2.3 (sorry I don't know from which previous version), functions ftp_nlist() and ftp_rawlist() stopped working:

PHP Warning: ftp_nlist() [function.ftp-nlist]: open_basedir restriction in effect. File(/var/tmp/) is not within the allowed path(s): (/data/htdocs/domain.com/:/usr/local/share/pear/:/tmp/:/var/tmp/) in ...

Note that the required path does actually match an allowed paths entry:

- File(/var/tmp/)
- allowed path(s): (/data/htdocs/domain.com/:/usr/local/share/pear/:/tmp/:/var/tmp/)

I found several bugs that might be related to this one, see bugs nr. 40141, 41518, 41684; bug 13720 describes the same phenomenon but assumably for an other reason.

The functions work again after my ISP removed the trailing slashes from the open_basedir entries. This can't be a desirable solution, though!


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-27 12:23 UTC] derernst at gmx dot ch
I am working on shared hosting and don't have a server or a local PHP installation nor the knowledge how to maintain it. So I asked the ISP where the issue occurred to kindly try the new snapshot posted. I did not get an answer so far; if he does help with the test, I will post the results here as soon as possible.
Anyway if there was someone else who does not mind testing the snapshot with correct open_basedir settings and ftp_nlist() or ftp_rawlist(), I would highly appreciate this.
 [2007-07-06 08:33 UTC] derernst at gmx dot ch
The ISP informed me now that he will not install the snapshot as he does not have a test environment, and only wants to run stable releases. So I am sorry I am not able to provide feedback about the snapshot.
 [2007-07-06 09:12 UTC] tony2001@php.net
You can safely install everything you want in your home directory.
 [2007-07-14 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-03-26 12:53 UTC] phpbts at gmx-topmail dot de
I'm experiencing the same problem even with the latest stable version 5.2.5 and also the latest snapshot (OS: Debian Sarge). There are already a few bugs concerning this issue and it has never been fixed so far. As in #39555 the user tried using TMPDIR to define a user defined temporary directory - I would really like to have such a flexible solution. Is there any way to implement such solution?
 [2008-04-06 14:20 UTC] devil987 at seznam dot cz
I can confirm that this problem is still present even in the latest stable PHP 5.2.5.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC