php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44079 session.save_path MODE will not set write bit
Submitted: 2008-02-08 23:21 UTC Modified: 2008-02-12 20:50 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jrod at blacknode dot net Assigned:
Status: Closed Package: Session related
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
 [2008-02-08 23:21 UTC] jrod at blacknode dot net
Description:
------------
bug #42596 (http://bugs.php.net/bug.php?id=42596) is not fixed in php 5.2.5. Setting the session.save_path variable still does not set the write bit on group or world when the mode is specified like so 0;0660;/var/lib/php/session.


Reproduce code:
---------------
session.save_path = 0;0660;/var/lib/php/session

Session test script:
<?
session_start();
// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
if (!isset($_SESSION['count'])) {
    $_SESSION['count'] = 0;
} else {
    $_SESSION['count']++;
}

        print('Count: ' . $_SESSION['count']);
?>




Expected result:
----------------
Sessions should be created with 660 permissions:

-rw-rw----  1 apache session      0 Feb  8 22:41 sess_antgke265hvd98pimudnu1gk30
-rw-rw----  1 apache session      0 Feb  8 18:43 sess_fm3l3rumegt8gkof285ft68pj4
-rw-rw----  1 apache session      0 Feb  8 18:42 sess_v94jcs3ks7df71p755686s6p67

Actual result:
--------------
Sessions created with mod_php

-rw-r-----  1 apache session      0 Feb  8 22:41 sess_antgke265hvd98pimudnu1gk30
-rw-r-----  1 apache session      0 Feb  8 18:43 sess_fm3l3rumegt8gkof285ft68pj4
-rw-r-----  1 apache session      0 Feb  8 18:42 sess_v94jcs3ks7df71p755686s6p67

Sessions created with mod_suphp:

drwxrws---  2 root      session 651264 Feb  8 23:10 .
drwxr-xr-x  3 root      root      4096 Nov 19 18:28 ..
-rw-rw----  1 adm_suphp session     10 Feb  8 23:09 sess_0bico36eatq7l6lmnb23n93gj4
-rw-rw----  1 adm_suphp session     10 Feb  8 23:10 sess_375iktr5nmu7eccbh063aj0nn5
-rw-rw----  1 adm_suphp session     10 Feb  8 23:10 sess_9kbvgjtdhq290ojuoumcg712m5

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-09 21:37 UTC] jrod at blacknode dot net
Bump
 [2008-02-10 14:34 UTC] iliaa@php.net
Works fine in CVS, what is your umask set to? Have you tried doing 
umask(0) before session_start() ?
 [2008-02-12 20:50 UTC] jrod at blacknode dot net
Thank you for that, umask(0) remedied the issue. 

Regards!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Sep 06 05:00:01 2025 UTC