From: Sascha Schumann Date: Wed, 6 Mar 2002 12:25:01 +0000 (+0000) Subject: Did not revert back enough. X-Git-Tag: php-4.2.0RC1~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c69739feb56ed293ef23c246ef95cd87cd39a77;p=php Did not revert back enough. This patch does not make sense, because it enforces the existence of a single directory. --- diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c index 80bacbd4fa..1f05b4b733 100644 --- a/ext/session/mod_mm.c +++ b/ext/session/mod_mm.c @@ -249,6 +249,7 @@ static void ps_mm_destroy(ps_mm *data) PHP_MINIT_FUNCTION(ps_mm) { + int save_path_len = strlen(PS(save_path)); int mod_name_len = strlen(sapi_module.name); char *ps_mm_path, euid[30]; int ret; @@ -260,10 +261,14 @@ PHP_MINIT_FUNCTION(ps_mm) if (!sprintf(euid,"%d", geteuid())) return FAILURE; - /* '/tmp/' + File + Module Name + Effective UID + \0 */ - ps_mm_path = do_alloca(5+sizeof(PS_MM_FILE)+mod_name_len+strlen(euid)+1); + /* Directory + '/' + File + Module Name + Effective UID + \0 */ + ps_mm_path = do_alloca(save_path_len+1+sizeof(PS_MM_FILE)+mod_name_len+strlen(euid)+1); - memcpy(ps_mm_path, "/tmp/", 5); + memcpy(ps_mm_path, PS(save_path), save_path_len + 1); + if (save_path_len > 0 && ps_mm_path[save_path_len - 1] != DEFAULT_SLASH) { + ps_mm_path[save_path_len] = DEFAULT_SLASH; + ps_mm_path[save_path_len+1] = '\0'; + } strcat(ps_mm_path, PS_MM_FILE); strcat(ps_mm_path, sapi_module.name); strcat(ps_mm_path, euid);