Bug #63968 [Fbk->NoF]: Wrong permissions for temporary files on upload

From: Date: Sun, 19 Sep 2021 04:22:08 +0000
Subject: Bug #63968 [Fbk->NoF]: Wrong permissions for temporary files on upload
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236681@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63968&edit=1

 ID:               63968
 Updated by:       php-bugs@lists.php.net
 Reported by:      web at bartwell dot ru
 Summary:          Wrong permissions for temporary files on upload
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          Unknown/Other Function
 Operating System: FreeBSD 8.0
 PHP Version:      5.4.10
 Assigned To:      cmb
 Private report:   N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2021-09-09 13:44:56] cmb@php.net

Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>

------------------------------------------------------------------------
[2013-01-11 20:08:36] web at bartwell dot ru

I'm upload my patch here. Now it working fine with this patch, but show the warning
"Warning: move_uploaded_file(): Operation not permitted in /path/to/script.php on line
111". How to suppress this warning - I don't know.

------------------------------------------------------------------------
[2013-01-11 15:36:55] web at bartwell dot ru

Description:
------------
I have server with FreeBSD 8.0, Apache 2.2.23 and PHP 5.4.10. That is my VirtualHost config:
<VirtualHost *>
    ServerName site.com
    ServerAlias www.site.com
    DocumentRoot /usr/home/site/pub/htdocs/
    php_admin_value open_basedir /usr/home/site/
    php_admin_value session.save_path 0;0660;/usr/home/site/pub/tmp/
    php_admin_value upload_tmp_dir /usr/home/site/pub/tmp/
</VirtualHost>

/usr/home/site/pub/tmp/ owned by site:www with 4770 permission. Session files creating correctly
(660 and site:www). But uploaded temporary files creating with 600 in permissions. So, because this
temporary file owned by site:www and Apache running from www:www, move_uploaded_file() cannot move
file.

How to fix it?

I think that I need patch PHP for force set permission on this tmp file. But where? And which
internal function in PHP can to do it?

Expected result:
----------------
I want that the temporary file creating with 660 permissions (and site:www).

Actual result:
--------------
This temporary file creating with 600 permissions (and site:www).


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=63968&edit=1


Thread (8 messages)

« previous php.bugs (#236681) next »