Current time: 11-16-2024, 11:00 AM Hello There, Guest! (LoginRegister)


Post Reply 
PHP uploads are not readable
Author Message
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #11
RE: PHP uploads are not readable
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
11-04-2007 09:13 PM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #12
RE: PHP uploads are not readable
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
(This post was last modified: 11-05-2007 01:40 AM by joximu.)
11-05-2007 01:27 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Marcel Offline
Junior Member
*
Beta Team

Posts: 35
Joined: Oct 2006
Reputation: 0
Post: #13
RE: PHP uploads are not readable
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).
11-13-2007 06:49 AM
Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #14
RE: PHP uploads are not readable
Good idea!
Done - hope this will corrected very fast...

Greez BeNe
11-13-2007 06:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #15
RE: PHP uploads are not readable
just voted...
11-13-2007 06:55 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Marcel Offline
Junior Member
*
Beta Team

Posts: 35
Joined: Oct 2006
Reputation: 0
Post: #16
RE: PHP uploads are not readable
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".
12-09-2007 02:16 AM
Find all posts by this user Quote this message in a reply
RatS Offline
Project Leader
******

Posts: 1,854
Joined: Oct 2006
Reputation: 17
Post: #17
RE: PHP uploads are not readable
sourceforge has problems with their dolwnloads... still waiting
12-09-2007 04:55 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)