On Tue, Feb 23, 2010 at 8:51 PM, DoOrsOfpErcEpTiON <[email protected]> wrote:

> > What user owns the files uploaded by apache?
> httpd : u:apache g:red5
>
> >You need to set the umask
> > in this user's .profile.
> Oh.. forgot to mention in last mail.. as I typed in hurry.
> Apart from the things I mentioned b4. I had also checked umask of root (since 
> apache is started by root)
> which shows as 022. i.e. effective 644
> also checked for apache user which is same as above.
> also modified umask for apache (from bash) and tested out by creating files. 
> it creates as modified umask. but it doesnt not set the same permission when 
> uploading from browser.
> What I doubt in the above is that the uploaded files are stored in another 
> location which belongs to another user. Apache permission are given using 
> facl---could it be the reason that it is not following the usmask?

Since apache is started by root, it will inherit root's umask. In your
case 022. Files uploaded will have permissions rw-r---r--
You can include the umask() function in your php script to change
this. (Altering root's umask is the easier solution, but obviously not
recommended for security reasons.)

There might be better solutions, but this is all I can think of at the moment.

> I also checked for the file envars which some have mentioned that umask can 
> be set in it. But I can not locate that file in my installation. As per path 
> mentioned in mailists, it appears to be a source compilation.

envars isn't present on RH/Centos. It's for Ubuntu/Debian.


Regards,
NMK.

Reply via email to