cvs: php4 /ext/session mod_mm.c
| From: | Yasuo Ohgaki | Date: | Fri, 25 Jan 2002 20:59:24 +0000 |
| Subject: | cvs: php4 /ext/session mod_mm.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9181@lists.php.net to get a copy of this message | ||
yohgaki Fri Jan 25 15:59:24 2002 EDT
Modified files:
/php4/ext/session mod_mm.c
Log:
We need mm file for each user.
# GCI/CLI SAPI need this. It might be better to disable mm save handler
# for CGI/CLI, though.
Index: php4/ext/session/mod_mm.c
diff -u php4/ext/session/mod_mm.c:1.30 php4/ext/session/mod_mm.c:1.31
--- php4/ext/session/mod_mm.c:1.30 Thu Jan 24 23:36:26 2002
+++ php4/ext/session/mod_mm.c Fri Jan 25 15:59:24 2002
@@ -16,12 +16,13 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mod_mm.c,v 1.30 2002/01/25 04:36:26 yohgaki Exp $ */
+/* $Id: mod_mm.c,v 1.31 2002/01/25 20:59:24 yohgaki Exp $ */
#include "php.h"
#ifdef HAVE_LIBMM
+#include <unistd.h>
#include <mm.h>
#include <time.h>
#include <sys/stat.h>
@@ -250,24 +251,27 @@
{
int save_path_len = strlen(PS(save_path));
int mod_name_len = strlen(sapi_module.name);
- char *ps_mm_path;
+ char *ps_mm_path, euid[30];
int ret;
ps_mm_instance = calloc(sizeof(*ps_mm_instance), 1);
if (!ps_mm_instance)
return FAILURE;
-
- ps_mm_path = do_alloca(save_path_len + 1 + sizeof(PS_MM_FILE) + mod_name_len + 1); /* Directory +
'/' + File + Module Name + \0 */
+ if (!sprintf(euid,"%d", geteuid()))
+ return FAILURE;
+
+ /* 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, 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);
ret = ps_mm_initialize(ps_mm_instance, ps_mm_path);