Package: php5-memcached
Version: 1.0.2-1
Severity: important
Tags: upstream patch
Sessions never expire when using the "memcached" handler.
on line 2525 of php_memcached.c
sess_lifetime = zend_ini_long(ZEND_STRL("session.gc_maxlifetime"), 0);
must be replaced by
sess_lifetime = zend_ini_long(ZEND_STRS("session.gc_maxlifetime"), 0);
zend_ini_long() expects a string length including the
termination zero byte. As such, the ZEND_STRS macro has to be
used and not the ZEND_STRL.
the same bug exists with "max_execution_time" but do not seems to cause
frequent problems
Patch:
--- memcached-1.0.2/php_memcached.c.orig 1970-01-01 10:13:08.000000000
+0100
+++ memcached-1.0.2/php_memcached.c 2011-02-26 21:51:07.652023126 +0100
@@ -2412,7 +2412,7 @@
memcached_return status;
/* set max timeout for session_start = max_execution_time. (c) Andrei
Darashenka, Richter & Poweleit GmbH */
- lock_maxwait = zend_ini_long(ZEND_STRL("max_execution_time"), 0);
+ lock_maxwait = zend_ini_long(ZEND_STRS("max_execution_time"), 0);
if (lock_maxwait <= 0) {
lock_maxwait = MEMC_SESS_LOCK_EXPIRATION;
}
@@ -2522,7 +2522,7 @@
memcached_st *memc_sess = PS_GET_MOD_DATA();
sess_key_len = spprintf(&sess_key, 0, "memc.sess.key.%s", key);
- sess_lifetime = zend_ini_long(ZEND_STRL("session.gc_maxlifetime"), 0);
+ sess_lifetime = zend_ini_long(ZEND_STRS("session.gc_maxlifetime"), 0);
if (sess_lifetime > 0) {
expiration = time(NULL) + sess_lifetime;
} else {
see https://bugs.php.net/bug.php?id=59641 for details
-- System Information:
Debian Release: 6.0.4
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]