From:             todd at stew dot org
Operating system: Redhat 9 and Fedora
PHP version:      4.3.6
PHP Bug Type:     Apache2 related
Bug description:  umask is not being restored when each request is finished.

Description:
------------
The apache child's umask is reset and not restored.

This behavior is present in
the redhat php-4.2.2-17.2 rpm, my custom install of 4.3.4 and my custom
install of 4.3.6 (compiled yesterday). It happens with both apache 2.0.40
and 2.0.48.



Reproduce code:
---------------
create a cgi file that touches a random filename and lists that file;

#!/bin/bash
echo "content-type: text/plain"
echo
touch /tmp/$UNIQUE_ID
ls -ald /tmp/$UNIQUE_ID

create a php file that sets a umask
<?
umask(077);
?>

Set apache to only spawn one child.
hit the cgi file then hit the php file then hit the cgi file.



Expected result:
----------------
The umask should not change for the cgi's and should only change for the
php script.

Actual result:
--------------
The umask remains sticky to the apache child.

-- 
Edit bug report at http://bugs.php.net/?id=28401&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28401&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28401&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28401&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28401&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28401&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28401&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28401&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28401&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28401&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28401&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28401&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28401&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28401&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28401&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28401&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28401&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28401&r=float

Reply via email to