php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13500 copy() gives incorrect open_basedir() errors
Submitted: 2001-10-01 14:38 UTC Modified: 2005-01-31 23:10 UTC
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:1 of 3 (33.3%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: nate at newdream dot net Assigned:
Status: Not a bug Package: Safe Mode/open_basedir
PHP Version: 4.0.6 OS: Debian GNU/Linux 2.4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nate at newdream dot net
New email:
PHP Version: OS:

 

 [2001-10-01 14:38 UTC] nate at newdream dot net
It appears that copy() is overprotective of open_basedir restrictions.

At the web host I administer we restrict each VirtualHost to the owning user's homedir using php_admin_value open_basedir /tmp:/home/user

All is well unless the user attempts to copy files. With ANY file copying operation, even copying files within one directory that is allowed by open_basedir, copy() fails with an open_basedir error (File is in wrong directory, open_basedir restriction in effect.) The directory the error complains about is ALWAYS allowed in the user's open_basedir setting.

This is especially evident when uploading files. open_basedir is set to allow for access to /tmp, but if users attempt to copy() an uploaded file from /tmp to /home/user, it gives an error. If the user instead calls move_uploaded_file() it is successful.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-14 12:32 UTC] yves at creationz dot org
Red Hat 7.2, Apache 1.3.20, PHP 4.0.6-12 using Plesk 2.5

copy() is working fine for me with 
<Directory "/home/httpd/vhosts/mydomain.com/httpdocs">
  php_admin_value upload_tmp_dir "/tmp"
  php_admin_value open_basedir "/home/httpd/vhosts/mydomain.com/httpdocs:/tmp"
</Directory>
 [2002-07-05 14:25 UTC] sniper@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC