From a500d1efe99138ffbbaa6685523d083d9a9ca0ad Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 3 Mar 2007 15:07:31 +0000 Subject: [PATCH] Adjust checks to allow paths without a trailing / --- ext/session/mod_files.c | 12 +++++++----- ext/session/session.c | 2 +- 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; } -- 2.40.0