Edit report at https://bugs.php.net/bug.php?id=60704&edit=1
ID: 60704
Patch added by: s...@php.net
Reported by:dean at dacunha dot net
Summary:unlink() bug with some files path
Status: Assigned
Type: Bug
Package:Filesystem function related
Operating System: Linux 3.0.0-14-generic #23-Ubunt
PHP Version:5.3.10
Assigned To:shm
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: themostevilpatchever2.patch
Revision: 1329040416
URL:
https://bugs.php.net/patch-display.php?bug=60704&patch=themostevilpatchever2.patch&revision=1329040416
Previous Comments:
[2012-02-11 08:32:47] s...@php.net
Attached patch should fix this issue. Will commit if after a review.
[2012-02-11 08:32:04] s...@php.net
The following patch has been added/updated:
Patch Name: themostevilpatchever.patch
Revision: 1328949124
URL:
https://bugs.php.net/patch-display.php?bug=60704&patch=themostevilpatchever.patch&revision=1328949124
[2012-02-06 14:55:40] dean at dacunha dot net
Hi,
I've just tested with php 5.3.10, the bug is still here.
Do you still need me to test with version 5.3.9 ?
Here is the proof:
root@djavanubu:/root#
root@djavanubu:/root# cat b.php
#!/usr/local/bin/php
root@djavanubu:/root#
root@djavanubu:/root# /usr/local/bin/php -v
PHP 5.3.10 (cli) (built: Jan 31 2012 22:48:16)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
root@djavanubu:/root#
root@djavanubu:/root#
root@djavanubu:/root# ./b.php
Warning: unlink(BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's Robot
List.mp3): No such file or directory in /root/b.php on line 7
root@djavanubu:/root#
root@djavanubu:/root# rm "/mnt/M:/NEWBASE/BRASIL/Carlinhos
Brown/Alfagamabetizado - Angel's Robot List.1.2.mp3"
root@djavanubu:/root#
root@djavanubu:/root# strace ./b.php
[...]
lstat("/mnt/M://BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's Robot
List.mp3", {st_mode=S_IFREG|0755, st_size=1247232, ...}) = 0
lstat("/mnt/M://BRASIL/Carlinhos Brown", {st_mode=S_IFDIR|0755, st_size=40960,
...}) = 0
lstat("/mnt/M://BRASIL", {st_mode=S_IFDIR|0755, st_size=81920, ...}) = 0
link("/mnt/M://BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's Robot
List.mp3", "/mnt/M:/NEWBASE/BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's
Robot List.1.2.mp3") = 0
unlink("BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's Robot List.mp3") = -1
ENOENT (No such file or directory)
write(1, "\nWarning: unlink(BRASIL/Carlinho"..., 135
Warning: unlink(BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's Robot
List.mp3): No such file or directory in /root/b.php on line 7
) = 135
[...]
[2012-01-27 05:42:04] carloschilazo at gmail dot com
Does this happen also in 5.3.9 ?
Please confirm so I can look into it
Thanks
[2012-01-10 19:58:07] dean at dacunha dot net
Description:
unlink() function truncates the file path name argument in some cases.
This bug appears also with the rename() function in the same cases.
The given source code use link() to duplicate a file, then unlink() to remove
the
source file. link() function works and unlink() bugs.
Test script:
---
#!/usr/local/bin/php
Expected result:
unlink() should remove the "/mnt/M://BRASIL/Carlinhos Brown/Alfagamabetizado -
Angel's Robot List.mp3" file
Actual result:
--
root@djavanubu:/# ./b.php
Warning: unlink(BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's Robot
List.mp3): No such file or directory in /b.php on line 8
###
below trace shows the truncated file path given to unlink() syscall:
[...]
lstat("/mnt/M://BRASIL", {st_mode=S_IFDIR|0755, st_size=69632, ...}) = 0
link("/mnt/M://BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's Robot
List.mp3", "/mnt/M:/NEWBASE/BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's
Robot List.1.2.mp3") = 0
unlink("BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's Robot List.mp3") = -1
ENOENT (No such file or directory)
write(1, "\nWarning: unlink(BRASIL/Carlinho"..., 130
Warning: unlink(BRASIL/Carlinhos Brown/Alfagamabetizado - Angel's Robot
List.mp3): No such file or directory in /b.php on line 8
) = 130
[...]
--
Edit this bug report at https://bugs.php.net/bug.php?id=60704&edit=1