File: dont-force-set-session.gc_probability%3D1.patch

package info (click to toggle)
roundcube 1.6.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 44,868 kB
  • sloc: javascript: 195,588; php: 76,818; sql: 3,150; sh: 2,882; pascal: 1,079; makefile: 234; xml: 93; perl: 73; ansic: 48; python: 21
file content (44 lines) | stat: -rw-r--r-- 1,757 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From: Guilhem Moulin <guilhem@debian.org>
Date: Wed, 29 Jun 2022 12:36:49 +0200
Subject: Don't force set session.gc_probability=1

We don't have to rely on probabilistic synchronous garbage collection
since we're running bin/gc.sh periodically.

If desired the local admin can manually set session.gc_probability > 0
in the PHP configuration (on Debian systems the default value is 0 which
disables probability based GC).  They may then want to disable the
cronjob or systemd.timer(5) unit.

This reverts upstream commit 32a0ad6778cde495e30f3447e5220136f0528cee.

Forwarded: not-needed
---
 program/lib/Roundcube/rcube.php | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index fd278b1..27ac7d3 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -450,7 +450,6 @@ class rcube
             return;
         }
 
-        $storage       = $this->config->get('session_storage', 'db');
         $sess_name     = $this->config->get('session_name');
         $sess_domain   = $this->config->get('session_domain');
         $sess_path     = $this->config->get('session_path');
@@ -483,12 +482,6 @@ class rcube
         ini_set('session.use_only_cookies', 1);
         ini_set('session.cookie_httponly', 1);
 
-        // Make sure session garbage collector is enabled when using custom handlers (#6560)
-        // Note: Use session.gc_divisor to control accuracy
-        if ($storage != 'php' && !ini_get('session.gc_probability')) {
-            ini_set('session.gc_probability', 1);
-        }
-
         // Start the session
         $this->session = rcube_session::factory($this->config);
         $this->session->register_gc_handler([$this, 'gc']);