summaryrefslogtreecommitdiff
path: root/ext/session
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:37 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:37 -0400
commit10f5b47dc7c1cf2b9a00991629f43652710322d3 (patch)
tree3b727a16f652b8042d573e90f003868ffb3b56c7 /ext/session
parent0e920280a2e04b110827bb766b9f29e3d581c4ee (diff)
downloadphp-10f5b47dc7c1cf2b9a00991629f43652710322d3.tar.gz
Imported Upstream version 5.0.5upstream/5.0.5
Diffstat (limited to 'ext/session')
-rw-r--r--ext/session/session.c20
-rw-r--r--ext/session/tests/007.phpt1
-rw-r--r--ext/session/tests/008-php4.2.3.phpt1
-rw-r--r--ext/session/tests/009.phpt1
-rw-r--r--ext/session/tests/bug31454.phpt2
5 files changed, 21 insertions, 4 deletions
diff --git a/ext/session/session.c b/ext/session/session.c
index 87f209dd6..37e56fd36 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: session.c,v 1.391.2.11 2005/03/24 00:17:53 tony2001 Exp $ */
+/* $Id: session.c,v 1.391.2.14 2005/05/22 12:57:45 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -131,13 +131,27 @@ static PHP_INI_MH(OnUpdateSerializer)
return SUCCESS;
}
+static PHP_INI_MH(OnUpdateSaveDir) {
+ /* Only do the safemode/open_basedir check at runtime */
+ if(stage == PHP_INI_STAGE_RUNTIME) {
+ if (PG(safe_mode) && (!php_checkuid(new_value, NULL, CHECKUID_ALLOW_ONLY_DIR))) {
+ return FAILURE;
+ }
+
+ if (php_check_open_basedir(new_value TSRMLS_CC)) {
+ return FAILURE;
+ }
+ }
+ OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return SUCCESS;
+}
/* {{{ PHP_INI
*/
PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("session.bug_compat_42", "1", PHP_INI_ALL, OnUpdateBool, bug_compat, php_ps_globals, ps_globals)
STD_PHP_INI_BOOLEAN("session.bug_compat_warn", "1", PHP_INI_ALL, OnUpdateBool, bug_compat_warn, php_ps_globals, ps_globals)
- STD_PHP_INI_ENTRY("session.save_path", "", PHP_INI_ALL, OnUpdateString, save_path, php_ps_globals, ps_globals)
+ STD_PHP_INI_ENTRY("session.save_path", "", PHP_INI_ALL, OnUpdateSaveDir,save_path, php_ps_globals, ps_globals)
STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateString, session_name, php_ps_globals, ps_globals)
PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateSaveHandler)
STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_ALL, OnUpdateBool, auto_start, php_ps_globals, ps_globals)
@@ -1134,7 +1148,7 @@ PHPAPI void php_session_start(TSRMLS_D)
*/
if (!PS(id)) {
- if (zend_hash_find(&EG(symbol_table), "_COOKIE",
+ if (PS(use_cookies) && zend_hash_find(&EG(symbol_table), "_COOKIE",
sizeof("_COOKIE"), (void **) &data) == SUCCESS &&
Z_TYPE_PP(data) == IS_ARRAY &&
zend_hash_find(Z_ARRVAL_PP(data), PS(session_name),
diff --git a/ext/session/tests/007.phpt b/ext/session/tests/007.phpt
index 7e13ab27e..a37b1db8f 100644
--- a/ext/session/tests/007.phpt
+++ b/ext/session/tests/007.phpt
@@ -8,6 +8,7 @@ session.cache_limiter=
register_globals=1
session.bug_compat_42=1
session.serialize_handler=php
+register_long_arrays=1
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/session/tests/008-php4.2.3.phpt b/ext/session/tests/008-php4.2.3.phpt
index 2785ddc2e..c1cc0c4c2 100644
--- a/ext/session/tests/008-php4.2.3.phpt
+++ b/ext/session/tests/008-php4.2.3.phpt
@@ -16,6 +16,7 @@ html_errors=0
display_errors=1
error_reporting=2039;
session.serialize_handler=php
+register_long_arrays=1
--FILE--
<?php
session_id("abtest");
diff --git a/ext/session/tests/009.phpt b/ext/session/tests/009.phpt
index a79cb931a..aa9e46eb5 100644
--- a/ext/session/tests/009.phpt
+++ b/ext/session/tests/009.phpt
@@ -9,6 +9,7 @@ register_globals=0
session.bug_compat_42=1
session.bug_compat_warn=0
session.serialize_handler=php
+register_long_arrays=1
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/session/tests/bug31454.phpt b/ext/session/tests/bug31454.phpt
index 6a013df27..67f4f3b42 100644
--- a/ext/session/tests/bug31454.phpt
+++ b/ext/session/tests/bug31454.phpt
@@ -17,5 +17,5 @@ echo "Done\n";
?>
--EXPECTF--
-Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s/bug31454.php on line %d
+Warning: session_set_save_handler(): Argument 1 is not a valid callback in %sbug31454.php on line %d
Done