diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2007-03-03 15:07:31 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2007-03-03 15:07:31 +0000 |
| commit | a500d1efe99138ffbbaa6685523d083d9a9ca0ad (patch) | |
| tree | cb4b526fefe169dd76535fc10488a465df0efe65 /ext/session | |
| parent | b15d1f22efd2b5ab25f06c481b98641599e764d8 (diff) | |
| download | php-git-a500d1efe99138ffbbaa6685523d083d9a9ca0ad.tar.gz | |
Adjust checks to allow paths without a trailing /
Diffstat (limited to 'ext/session')
| -rw-r--r-- | ext/session/mod_files.c | 12 | ||||
| -rw-r--r-- | 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; } |
