php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30946 Cant rename directories across partitions
Submitted: 2004-11-30 19:06 UTC Modified: 2004-12-03 03:01 UTC
From: paul at paulbaranowski dot org Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.3.8 OS: Redhat Enterprise Linux v3.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: paul at paulbaranowski dot org
New email:
PHP Version: OS:

 

 [2004-11-30 19:06 UTC] paul at paulbaranowski dot org
Description:
------------
The rename function says that renaming across partitions was fixed in 4.3.3, but it appears that it is broken in 4.3.8.

I have three partitions on my system:
/
/dev/shm
/tmp

I'm not sure if it matters, but the disk is mirrored with RAID level 1.

Trying to rename a directory that resides in "/tmp" to the "/" file system results in:

"Warning: rename(<from>, <to>): Is a directory in <script> on line XX."

and the <to> directory name is created as an empty file.

I moved the <from> directory to the "/" partition and then tried the rename again (using the same PHP code) and everything worked fine.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-30 21:37 UTC] paul at paulbaranowski dot org
I tried it with that snapshot and the problem is still there.
 [2004-11-30 21:52 UTC] tony2001@php.net
Please, provide a reproduce code so we can reproduce it ourselves.
 [2004-11-30 22:02 UTC] paul at paulbaranowski dot org
# mkdir /tmp/test
# touch /tmp/test/foo.txt
# emacs test.php
<?
rename("/tmp/test", "/root/test");
?>

# /usr/local/php-4.3.8/bin/php test.php

Warning: rename(/tmp/test,/root/test): Is a directory in /root/test.php on line 2.

(A empty file "test" has now been created in /root directory)
# rm test
# mkdir /root/test
# touch /root/test/foo.txt
# emacs test.php
<?
rename("/root/test", "/root/test2");
?>
# /usr/local/php-4.3.8/bin/php test.php
( "/root/test" directory renamed to "/root/test2")

# emacs test.php
<?
rename("/tmp/test", "/tmp/test2");
?>
# /usr/local/php-4.3.8/bin/php test.php
("/tmp/test" directory renamed to "/tmp/test2")
 [2004-12-03 03:01 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC