|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-09-10 23:43 UTC] iliaa@php.net
[2007-09-11 01:20 UTC] randy at rcs-comp dot com
[2009-04-06 11:56 UTC] bjori@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
Description: ------------ When using the mode parameter in session_save_path (or presumably session.save_path) it will not set the "write" bit correctly for anyone but the owner of the file. Read and execute bits are set correctly. This is important b/c I would like to setguid on the session directory so that a non-priveleged user (the website reseller) can clean it out. That way, all I have to do is add apache to the user's group, and no more problems with clearing out sessions. Reproduce code: --------------- <?php $pm = '0;0600;'.dirname(__FILE__).'/sessions'; session_save_path($pm); session_start(); die('hello world'); ?> // delete the session file just created <?php $pm = '0;0660;'.dirname(__FILE__).'/sessions'; session_save_path($pm); session_start(); die('hello world'); ?> // delete the session file just created <?php $pm = '0;0777;'.dirname(__FILE__).'/sessions'; session_save_path($pm); session_start(); die('hello world'); ?> Expected result: ---------------- [root@host sessions]# ls -l total 0 -rw------- 1 apache apache 0 Sep 7 23:30 sess_b1fb... [root@host sessions]# ls -l total 0 -rw-rw---- 1 apache apache 0 Sep 7 23:31 sess_b1fb... [root@host sessions]# ls -l total 0 -rwxrwxrwx 1 apache apache 0 Sep 7 23:40 sess_b1fb... Actual result: -------------- [root@host sessions]# ls -l total 0 -rw------- 1 apache apache 0 Sep 7 23:30 sess_b1fb... [root@host sessions]# ls -l total 0 -rw-r----- 1 apache apache 0 Sep 7 23:31 sess_b1fb... ^^^^^^^^^^ <---------------- Permission does not have write bit [root@host sessions]# ls -l total 0 -rwxr-xr-x 1 apache apache 0 Sep 7 23:40 sess_b1fb... ^^^^^^^^^^ <---------------- Permission does not have write bits