php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64565 copy doesn't report failure on partial copy
Submitted: 2013-04-02 14:12 UTC Modified: 2013-04-02 14:13 UTC
From: remi@php.net Assigned: remi (profile)
Status: Closed Package: Filesystem function related
PHP Version: 5.4.13 OS: GNU/Linux
Private report: No CVE-ID: None
 [2013-04-02 14:12 UTC] remi@php.net
Description:
------------
When destination folder of a copy haven't enough place, copy reports success instead of failure.


Test script:
---------------
<?php
$file = "somefile";
$tmpdir = "/mnt/test/";

echo "Source: ".($src=filesize($file))."\n";

for ($i=0 ; $i<7 ; $i++) {
  $res = copy($file, $tmpdir.$i);
  $dst = filesize($tmpdir.$i);
  echo "$i:".($res ? ($dst==$src ? "ok" : "ISSUE ($dst/$src)") : "ko")."\n";
}


Expected result:
----------------
Source: 107520
0:ok
1:ok
2:ok
3:ok
4:ko
5:ko
6:ko


Actual result:
--------------
Source: 107520
0:ok
1:ok
2:ok
3:ok
4:ISSUE (49152/107520)
5:ko
6:ko


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-02 14:13 UTC] remi@php.net
-Assigned To: +Assigned To: remi
 [2013-04-02 14:24 UTC] remi@php.net
-Status: Assigned +Status: Closed
 [2013-04-02 14:24 UTC] remi@php.net
Automatic comment on behalf of remi
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6b4148bc9705d2668dd8589009215a8eb3076f31
Log: Fixed Bug #64565 copy doesn't report failure on partial copy
 [2014-10-07 23:19 UTC] stas@php.net
Automatic comment on behalf of remi
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=6b4148bc9705d2668dd8589009215a8eb3076f31
Log: Fixed Bug #64565 copy doesn't report failure on partial copy
 [2014-10-07 23:30 UTC] stas@php.net
Automatic comment on behalf of remi
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=6b4148bc9705d2668dd8589009215a8eb3076f31
Log: Fixed Bug #64565 copy doesn't report failure on partial copy
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC