umask errors when using cgi and fcgi

I have found a really bad setting when it comes to uploading files with cgi and fcgi support turned on.

The umask is set 002 which only allows wr for user and preventing files from being accessed.

My fix for php5.cgi was...

#!/bin/sh
PHPRC=$DOCUMENT_ROOT/../etc/php5
export PHPRC
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
umask 022
exec /usr/bin/php-cgi

and for fcgi...

#!/bin/sh
PHPRC=$PWD/../etc/php5
export PHPRC
PHP_FCGI_CHILDREN=4
export PHP_FCGI_CHILDREN
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
umask 022
exec /usr/bin/php-cgi

This needs to be fixed.

Status: 
Closed (fixed)