wez             Mon Mar 29 16:44:08 2004 EDT

  Modified files:              
    /php-src    php.ini-dist php.ini-recommended 
    /php-src/ext/session        mod_files.c session.c 
    /php-src/main       php_open_temporary_file.c php_open_temporary_file.h 
  Log:
  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.
  
  
  
http://cvs.php.net/diff.php/php-src/php.ini-dist?r1=1.211&r2=1.212&ty=u
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.211 php-src/php.ini-dist:1.212
--- php-src/php.ini-dist:1.211  Sun Mar 14 17:00:22 2004
+++ php-src/php.ini-dist        Mon Mar 29 16:44:07 2004
@@ -860,7 +860,7 @@
 ;
 ; where MODE is the octal representation of the mode. Note that this
 ; does not overwrite the process's umask.
-session.save_path = "/tmp"
+;session.save_path = "/tmp"
 
 ; Whether to use cookies.
 session.use_cookies = 1
http://cvs.php.net/diff.php/php-src/php.ini-recommended?r1=1.155&r2=1.156&ty=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.155 php-src/php.ini-recommended:1.156
--- php-src/php.ini-recommended:1.155   Sun Mar 14 16:36:17 2004
+++ php-src/php.ini-recommended Mon Mar 29 16:44:07 2004
@@ -882,7 +882,7 @@
 ;
 ; where MODE is the octal representation of the mode. Note that this
 ; does not overwrite the process's umask.
-session.save_path = "/tmp"
+;session.save_path = "/tmp"
 
 ; Whether to use cookies.
 session.use_cookies = 1
http://cvs.php.net/diff.php/php-src/ext/session/mod_files.c?r1=1.94&r2=1.95&ty=u
Index: php-src/ext/session/mod_files.c
diff -u php-src/ext/session/mod_files.c:1.94 php-src/ext/session/mod_files.c:1.95
--- php-src/ext/session/mod_files.c:1.94        Thu Jan  8 03:17:23 2004
+++ php-src/ext/session/mod_files.c     Mon Mar 29 16:44:07 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: mod_files.c,v 1.94 2004/01/08 08:17:23 andi Exp $ */
+/* $Id: mod_files.c,v 1.95 2004/03/29 21:44:07 wez Exp $ */
 
 #include "php.h"
 
@@ -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 @@
        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, ';');
http://cvs.php.net/diff.php/php-src/ext/session/session.c?r1=1.386&r2=1.387&ty=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.386 php-src/ext/session/session.c:1.387
--- php-src/ext/session/session.c:1.386 Sat Feb 28 19:26:36 2004
+++ php-src/ext/session/session.c       Mon Mar 29 16:44:07 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: session.c,v 1.386 2004/02/29 00:26:36 moriyoshi Exp $ */
+/* $Id: session.c,v 1.387 2004/03/29 21:44:07 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -137,7 +137,7 @@
 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)
http://cvs.php.net/diff.php/php-src/main/php_open_temporary_file.c?r1=1.29&r2=1.30&ty=u
Index: php-src/main/php_open_temporary_file.c
diff -u php-src/main/php_open_temporary_file.c:1.29 
php-src/main/php_open_temporary_file.c:1.30
--- php-src/main/php_open_temporary_file.c:1.29 Thu Jan  8 03:17:54 2004
+++ php-src/main/php_open_temporary_file.c      Mon Mar 29 16:44:07 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_open_temporary_file.c,v 1.29 2004/01/08 08:17:54 andi Exp $ */
+/* $Id: php_open_temporary_file.c,v 1.30 2004/03/29 21:44:07 wez Exp $ */
 
 #include "php.h"
 
@@ -164,7 +164,7 @@
 /*
  *  Determine where to place temporary files.
  */
-const char* get_temporary_directory()
+PHPAPI const char* php_get_temporary_directory(void)
 {
        /* Cache the chosen temporary directory. */
        static char* temporary_directory;
@@ -231,7 +231,7 @@
        fd = php_do_open_temporary_file(dir, pfx, opened_path_p TSRMLS_CC);
        if (fd == -1) {
                /* Use default temporary directory. */
-               fd = php_do_open_temporary_file(get_temporary_directory(), pfx, 
opened_path_p TSRMLS_CC);
+               fd = php_do_open_temporary_file(php_get_temporary_directory(), pfx, 
opened_path_p TSRMLS_CC);
        }
        return fd;
 }
http://cvs.php.net/diff.php/php-src/main/php_open_temporary_file.h?r1=1.11&r2=1.12&ty=u
Index: php-src/main/php_open_temporary_file.h
diff -u php-src/main/php_open_temporary_file.h:1.11 
php-src/main/php_open_temporary_file.h:1.12
--- php-src/main/php_open_temporary_file.h:1.11 Fri Feb 20 03:04:30 2004
+++ php-src/main/php_open_temporary_file.h      Mon Mar 29 16:44:07 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_open_temporary_file.h,v 1.11 2004/02/20 08:04:30 hholzgra Exp $ */
+/* $Id: php_open_temporary_file.h,v 1.12 2004/03/29 21:44:07 wez Exp $ */
 
 #ifndef PHP_OPEN_TEMPORARY_FILE_H
 #define PHP_OPEN_TEMPORARY_FILE_H
@@ -24,6 +24,7 @@
 BEGIN_EXTERN_C()
 PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char 
**opened_path_p TSRMLS_DC);
 PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char 
**opened_path_p TSRMLS_DC);
+PHPAPI const char *php_get_temporary_directory(void);
 END_EXTERN_C()
 
 #endif /* PHP_OPEN_TEMPORARY_FILE_H */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to