php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6958 mod_mm: session WRITE returns FAILURE when vallen=0
Submitted: 2000-09-30 05:37 UTC Modified: 2000-09-30 05:51 UTC
From: tcarroll at chc-chimes dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.2 OS: FreeBSD 4.01
Private report: No CVE-ID: None
 [2000-09-30 05:37 UTC] tcarroll at chc-chimes dot com
when session.save_handler = mm

the following script will cause a error logging
<?php
   session_start();
?>

The error is produced:
PHP Warning:  Failed to write session data (mm). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
<br>
<b>Warning</b>:  Failed to write session data (mm). Please verify that the current setting of session.save_path is correct (/tmp) in <b>Unknown</b> on line <b>0</b><br>

mod_mm WRITE returns failure for vallen = 0.

Following is a diff.  Also fixes small problems when the module reports errors in debug mode.

--- mod_mm.c	Mon Jul 10 06:09:14 2000
+++ mod_mm.c.tom	Fri Sep 29 17:05:38 2000
@@ -162,7 +162,7 @@
 		ps_mm_debug("optimizing\n");
 	}
 
-	ps_mm_debug(stderr, "lookup(%s): ret=%x,h=%d\n", key, ret, h);
+	ps_mm_debug("lookup(%s): ret=%x,h=%d\n", key, ret, h);
 	
 	return ret;
 }
@@ -256,14 +256,16 @@
 	PS_MM_DATA;
 	ps_sd *sd;
 
+	if ( vallen == 0 ) return SUCCESS;
+
 	mm_lock(data->mm, MM_LOCK_RW);
 
 	sd = ps_sd_lookup(data, key, 1);
 	if (!sd) {
 		sd = ps_sd_new(data, key, val, vallen);
-		ps_mm_debug(stderr, "new one for %s\n", key);
+		ps_mm_debug("new one for %s\n", key);
 	} else {
-		ps_mm_debug(stderr, "found existing one for %s\n", key);
+		ps_mm_debug("found existing one for %s\n", key);
 		mm_free(data->mm, sd->data);
 		sd->datalen = vallen;
 		sd->data = mm_malloc(data->mm, vallen);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-30 05:51 UTC] sas@php.net
Thanks, fixed in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 21:01:29 2024 UTC