php5 sessionmanagement ignores values in custom ini files

Bug #916065 reported by Tom Penndorf
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Fix Released
Medium
James Page
Precise
Fix Released
Medium
James Page

Bug Description

if the variable session.gc_maxlifetime is defined in /etc/php5/*/conf.d/*.ini the cronjob in /etc/cron.d/php5
will ignore the value and use the default value of 1440.

To fix ist, use this diff for /usr/lib/php5/maxlifetime

--- maxlifetime 2012-01-13 16:23:46.000000000 +0100
+++ maxlifetime.patched 2012-01-13 16:23:28.000000000 +0100
@@ -7,7 +7,7 @@
   [ -z "$cur" ] && cur=0
   [ "$cur" -gt "$max" ] && max=$cur
 else
- for ini in /etc/php5/*/php.ini; do
+ for ini in /etc/php5/*/php.ini /etc/php5/*/conf.d/*.ini; do
           cur=$(sed -n -e 's/^[[:space:]]*session.gc_maxlifetime[[:space:]]*=[[:space:]]*\([0-9]\+\).*$/\1/p' $ini 2>/dev/null || true);
           [ -z "$cur" ] && cur=0
           [ "$cur" -gt "$max" ] && max=$cur

Architecture: amd64
Distribution: Ubuntu 11.10
package: php5-common 5.3.6-13ubuntu3.3

Tags: patch

Related branches

Revision history for this message
Tom Penndorf (tpenndorf) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "maxlifetime.diff" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Dave Walker (davewalker)
Changed in php5 (Ubuntu):
importance: Undecided → High
Revision history for this message
Ondřej Surý (ondrej) wrote :

Slightly better patch now in debian git.

Scans all relevant SAPI's configurations and if not found (or php5 not installed), it will scan /etc/php5/*/php.ini and /etc/php5/conf.d/*.ini

James Page (james-page)
Changed in php5 (Ubuntu):
status: New → Confirmed
importance: High → Medium
status: Confirmed → Triaged
James Page (james-page)
Changed in php5 (Ubuntu Precise):
assignee: nobody → James Page (james-page)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package php5 - 5.3.10-1ubuntu3

---------------
php5 (5.3.10-1ubuntu3) precise; urgency=low

  * Cherry picked fixes from Debian testing:
    - d/maxlifetime: Improve maxlifetime script to scan for more SAPIs and
      scan all *.ini in conf.d directory.
      (LP: #916065).
    - d/libapache2-mod-php5.postinst,libapache2-mod-php5filter.postinst:
      Restart apache on first install to ensure module is fully enabled.
      (LP: #953081).
 -- James Page <email address hidden> Wed, 11 Apr 2012 14:27:10 +0100

Changed in php5 (Ubuntu Precise):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.