php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66940 move_uploaded_file() behavior is very inconsistent
Submitted: 2014-03-22 04:19 UTC Modified: 2014-03-22 04:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: ryosuke_i_628 at yahoo dot co dot jp Assigned:
Status: Open Package: *General Issues
PHP Version: 5.6.0alpha3 OS:
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: ryosuke_i_628 at yahoo dot co dot jp
New email:
PHP Version: OS:

 

 [2014-03-22 04:19 UTC] ryosuke_i_628 at yahoo dot co dot jp
Description:
------------
On 5.2.5 release, the following change had been committed.

+ Fixed move_uploaded_file() to always set file permissions of resulting file according to UMASK. (Andrew Sitnikov)

However, this commit seems to be very inconsistent.
Some people say this commit is a bug (Bug #65057).

Test script:
---------------
Compare behaviors the actual implemention and what it should be.

Expected result:
----------------
new copy by php_copy_file_*
-> depends on UMASK

new rename by php_copy_file_*
-> depends on UMASK

overwrite copy by php_copy_file_*
-> depends on UMASK

overwrite rename by php_copy_file_*
-> depends on UMASK


or


new copy by php_copy_file_*
-> depends on its original permission

new rename by php_copy_file_*
-> depends on its original permission

overwrite copy by php_copy_file_*
-> depends on its original permission

overwrite rename by php_copy_file_*
-> depends on its original permission

Actual result:
--------------
new copy by php_copy_file_*
-> depends on UMASK

new rename by php_copy_file_*
-> depends on UMASK

overwrite copy by php_copy_file_*
-> depends on its original permission

overwrite rename by php_copy_file_*
-> depends on UMASK



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-03-22 04:22 UTC] ryosuke_i_628 at yahoo dot co dot jp
Please let me make corrections.


Expected result:
----------------
new copy by php_copy_file_*
-> depends on UMASK

new rename by VCWD_RENAME
-> depends on UMASK

overwrite copy by php_copy_file_*
-> depends on UMASK

overwrite rename by VCWD_RENAME
-> depends on UMASK


or


new copy by php_copy_file_*
-> depends on its original permission

new rename by VCWD_RENAME
-> depends on its original permission

overwrite copy by php_copy_file_*
-> depends on its original permission

overwrite rename by VCWD_RENAME
-> depends on its original permission

Actual result:
--------------
new copy by php_copy_file_*
-> depends on UMASK

new rename by VCWD_RENAME
-> depends on UMASK

overwrite copy by php_copy_file_*
-> depends on its original permission

overwrite rename by VCWD_RENAME
-> depends on UMASK
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 08 06:01:27 2024 UTC