summaryrefslogtreecommitdiff
path: root/ext/session
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2004-03-29 21:44:07 +0000
committerWez Furlong <wez@php.net>2004-03-29 21:44:07 +0000
commit32be6f268b59eed7ec5f1bcfd0a88e112a50dd85 (patch)
treed0563b087c985c809a33a89b2e695d7c24643578 /ext/session
parent904dac52e2f1445899598d727c7fb511defb9d10 (diff)
downloadphp-git-32be6f268b59eed7ec5f1bcfd0a88e112a50dd85.tar.gz
Fix for Bug #26757: session.save_path defaults to bogus value on win32
Merge from branch with one main difference: the default save_path is set to the empty string on all platforms, whereas the code in the branch only does so for win32.
Diffstat (limited to 'ext/session')
-rw-r--r--ext/session/mod_files.c6
-rw-r--r--ext/session/session.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index f4c35f9274..15cd5d7747 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -46,6 +46,7 @@
#include "php_session.h"
#include "mod_files.h"
#include "ext/standard/flock_compat.h"
+#include "php_open_temporary_file.h"
#define FILE_PREFIX "sess_"
@@ -239,6 +240,11 @@ PS_OPEN_FUNC(files)
size_t dirdepth = 0;
int filemode = 0600;
+ if (*save_path == '\0') {
+ /* if save path is an empty string, determine the temporary dir */
+ save_path = php_get_temporary_directory();
+ }
+
/* split up input parameter */
last = save_path;
p = strchr(save_path, ';');
diff --git a/ext/session/session.c b/ext/session/session.c
index 27bce4a2ba..ca8365dcd8 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -137,7 +137,7 @@ static PHP_INI_MH(OnUpdateSerializer)
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", "/tmp", PHP_INI_ALL, OnUpdateString, save_path, 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.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)