Re: cvs: php4 /ext/session mod_mm.c
| From: | derick@php.net | Date: | Wed, 06 Mar 2002 07:17:56 +0000 |
| Subject: | Re: cvs: php4 /ext/session mod_mm.c | ||
| References: | 1 | Groups: | php.cvs php.dev |
| Request: | Send a blank email to php-dev+get-80775@lists.php.net to get a copy of this message | ||
Hello,
On Wed, 6 Mar 2002, Yasuo Ohgaki wrote:
> yohgaki Wed Mar 6 01:29:43 2002 EDT
>
> Modified files:
> /php4/ext/session mod_mm.c
> Log:
> Make php start even with wrong save_path.
It's rather see it fail here, that way it is very obvious to the user that
something is not correct. The way you do not now will make sessions not
work, and there is not a very obvious reason why not.
Derick
>
>
> Index: php4/ext/session/mod_mm.c
> diff -u php4/ext/session/mod_mm.c:1.33 php4/ext/session/mod_mm.c:1.34
> --- php4/ext/session/mod_mm.c:1.33 Tue Mar 5 18:45:50 2002
> +++ php4/ext/session/mod_mm.c Wed Mar 6 01:29:43 2002
> @@ -16,7 +16,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: mod_mm.c,v 1.33 2002/03/05 23:45:50 yohgaki Exp $ */
> +/* $Id: mod_mm.c,v 1.34 2002/03/06 06:29:43 yohgaki Exp $ */
>
> #include "php.h"
>
> @@ -255,11 +255,13 @@
> int ret;
>
> ps_mm_instance = calloc(sizeof(*ps_mm_instance), 1);
> - if (!ps_mm_instance)
> - return FAILURE;
> + if (!ps_mm_instance) {
> + php_error(E_WARNING,"mm session save handler cannot allocate shared memory");
> + }
>
> - if (!sprintf(euid,"%d", geteuid()))
> - return FAILURE;
> + if (!sprintf(euid,"%d", geteuid())) {
> + php_error(E_WARNING,"mm session save handler cannot get effecitve UID");
> + }
>
> /* 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);
> @@ -280,7 +282,7 @@
> if (ret != SUCCESS) {
> free(ps_mm_instance);
> ps_mm_instance = NULL;
> - return FAILURE;
> + php_error(E_NOTICE,"mm session save handler failed to initialize. Check your
> save_path.");
> }
>
> php_session_register_module(&ps_mod_mm);
>
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
----------------------------------------------------------------------
PHP: Scripting the Web - derick@php.net
All your branches are belong to me!
-----------------------------------------------------------------------