ispCP - Board - Support
PHP uploads are not readable - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: Usage (/forum-34.html)
+--- Thread: PHP uploads are not readable (/thread-1710.html)

Pages: 1 2


RE: PHP uploads are not readable - joximu - 11-04-2007 09:13 PM

Hi Eminos

I did some researches about this problem. The umask is set correct: 0022 but it seems that php does not set (or removes) any group and world permissions - so there's a 0077 umask hidden in the php code - or it's somewhere else - I didn't found the hideout...

I also did some tests - one on a not very old ispcp server (just a move_uploaded_file) and the same on my 2 year old suse 10 server (with mod_php, no susexec, no fastcgi). They both have 0600 permissions on a newly uploaded files.

Well, of course with mod_php apache is able to read the files (owner = apache) which is not the case with ispcp/fastcgi/suexec - there you have to chmod the newly uploaded file.

I dug deeper: the temporary file already has the 0600 permissions set.

BUT: Now I got something very strange:
If I set the upload_tmp_dir to /tmp (with open_basedir adapted) then the file *there* also has 0600 permission mode but after the use of move_uploaded_file the files has 0644 mode (on the ispcp machine).

Very strange.

So, as a temporary solution I can give you an advice: use /tmp as upload_dir for the Joomla Customers.

And hey: Typo3 does correct the permissions after an upload :-)


Maybe someone else can have a look at this behaviour of php (raphael... ???)

Have a good sunday
Joximu


RE: PHP uploads are not readable - joximu - 11-05-2007 01:27 AM

Just one more thing:

If the upload_tmp_dir is on the same filesystem as the upload-folder (normally the webspace) then the uploaded file has 0600 rights (-rw-------). If it's on a different filesystem then it has 0644 (-rw-r--r--) ... (or sth else if the umask is not 0022)...

Seems to be a PHP bug.

Conclusion for ispcp:
put the upload dir for problematic domains to another perition on the harddisc.

/J

2. Edit: Further infos see php bug
http://bugs.php.net/bug.php?id=42291


RE: PHP uploads are not readable - Marcel - 11-13-2007 06:49 AM

Hi,

it would be the best if everyone can "vote" for this bug. Currently it affects all php version and it is under ispCP a real problem. You can find the vote under the bug report (http://bugs.php.net/bug.php?id=42291).


RE: PHP uploads are not readable - BeNe - 11-13-2007 06:54 AM

Good idea!
Done - hope this will corrected very fast...

Greez BeNe


RE: PHP uploads are not readable - rbtux - 11-13-2007 06:55 AM

just voted...


RE: PHP uploads are not readable - Marcel - 12-09-2007 02:16 AM

Hi,

the PHP Team made some changes regarding this bug. But they need some help. I have currently no pc so it's impossible for me.

Someone should test the php version posted in http://bugs.php.net/bug.php?id=42291 and change the bug back to "open".


RE: PHP uploads are not readable - RatS - 12-09-2007 04:55 AM

sourceforge has problems with their dolwnloads... still waiting