summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2002-03-06 12:25:01 +0000
committerSascha Schumann <sas@php.net>2002-03-06 12:25:01 +0000
commit0c69739feb56ed293ef23c246ef95cd87cd39a77 (patch)
treec191a3745450d5b3ab8650f6a74363b0c2962ecb
parent0bf5fc14be04ce3cff705ba36379b449219a4da9 (diff)
downloadphp-git-0c69739feb56ed293ef23c246ef95cd87cd39a77.tar.gz
Did not revert back enough.
This patch does not make sense, because it enforces the existence of a single directory.
-rw-r--r--ext/session/mod_mm.c11
1 files changed, 8 insertions, 3 deletions
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);