1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00

Did not revert back enough.

This patch does not make sense, because it enforces the existence
of a single directory.
This commit is contained in:
Sascha Schumann
2002-03-06 12:25:01 +00:00
parent 0bf5fc14be
commit 0c69739feb
+8 -3
View File
@@ -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);