summaryrefslogtreecommitdiff
path: root/ext/session/session.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-10-01 20:58:02 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-10-01 20:58:02 +0000
commit154f70acf1560bd6633cf7cce1efe1528f35c36f (patch)
tree4abb0943e8f958b3a4ca0f97235213b299f92cd5 /ext/session/session.c
parentbd088df90cee4bd6d81067acc32bc9cae3416897 (diff)
downloadphp-git-154f70acf1560bd6633cf7cce1efe1528f35c36f.tar.gz
Fixed bug #38993 (Fixed safe_mode/open_basedir checks for
session.save_path, allowing them to account for extra parameters).
Diffstat (limited to 'ext/session/session.c')
-rw-r--r--ext/session/session.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/session/session.c b/ext/session/session.c
index 3078cff9fc..1d6f991b14 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -154,11 +154,19 @@ 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))) {
+ char *p;
+
+ if ((p = zend_memrchr(new_value, ';', new_value_length))) {
+ p++;
+ } else {
+ p = new_value;
+ }
+
+ if (PG(safe_mode) && (!php_checkuid(p, NULL, CHECKUID_ALLOW_ONLY_DIR))) {
return FAILURE;
}
- if (php_check_open_basedir(new_value TSRMLS_CC)) {
+ if (php_check_open_basedir(p TSRMLS_CC)) {
return FAILURE;
}
}