Forum Moderators: phranque

Message Too Old, No Replies

script uploaded files have 600 and not 644 permissions

         

dsdc

5:18 pm on Aug 26, 2007 (gmt 0)

10+ Year Member



Hello -

My host did something and now the scripts I have that allow users to upload images are cmodding them to 600 instead of 644. This of course keeps the images from being viewed.

My host seems fairly clueless, so I have to track down the issue myself. I don't know much about apache, but I think they must have changed a setting in one of these places:

php.ini
suexec
phpsuexec
apache config.

Can anyone suggest the answer to this?

Thanks!

otie

8:13 pm on Aug 28, 2007 (gmt 0)

10+ Year Member



check selinux. You can find evidence of what's happening in the system log files - message and secure

Everything here requires root access.

We have a dedicated server. I had to change the selinux permissions for chmod

########################################################################################
# 2007/03/18 #
# httpd can't read files uploaded through server #
# this is nice, but screws up the kpftx archive - can't update shofile #
########################################################################################
allow httpd_sys_script_t httpd_tmp_t:file { read write };
allow httpd_sys_script_t httpd_tmp_t:file getattr;
########################################################################################

########################################################################################
# 2007/08/12 #
# httpd - id3v2 can't chmod and unlink - prevent's id3 tags being put into mp3 #
########################################################################################
allow httpd_sys_script_t httpd_tmp_t:file { setattr unlink };
########################################################################################
These are the entries I put into /etc/selinux/targeted/src/policy/domains/program/apache.te

This has to be compiled. cd to /etc/selinux/targeted/src/policy and then make.

Then pray.

Both of these entries refer to apache allowing an application (php script) to execute the functions.

Thanks to the NSA for all this safety. I turned it off on my development box.

Good luck.

O.