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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
48 + 2 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 26 18:01:31 2024 UTC