summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/session/mod_files.c12
-rw-r--r--ext/session/session.c2
2 files changed, 8 insertions, 6 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index df677bb388..ddb9376047 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -252,11 +252,13 @@ PS_OPEN_FUNC(files)
/* if save path is an empty string, determine the temporary dir */
save_path = php_get_temporary_directory();
- if (PG(safe_mode) && (!php_checkuid(save_path, NULL, CHECKUID_ALLOW_ONLY_DIR))) {
- return FAILURE;
- }
- if (php_check_open_basedir(save_path TSRMLS_CC)) {
- return FAILURE;
+ if (strcmp(save_path, "/tmp")) {
+ if (PG(safe_mode) && (!php_checkuid(save_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ return FAILURE;
+ }
+ if (php_check_open_basedir(save_path TSRMLS_CC)) {
+ return FAILURE;
+ }
}
}
diff --git a/ext/session/session.c b/ext/session/session.c
index da4e57481e..2b20dde0aa 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -163,7 +163,7 @@ static PHP_INI_MH(OnUpdateSaveDir)
p = new_value;
}
- if (PG(safe_mode) && (!php_checkuid(p, NULL, CHECKUID_ALLOW_ONLY_DIR))) {
+ if (PG(safe_mode) && (!php_checkuid(p, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
return FAILURE;
}