summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-08-08 14:54:49 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-08-08 14:54:49 +0000
commitd58b3869a71e83032874d4feacccea8985bdc53a (patch)
tree44e90a23527a5c7270a2268c0208fd16af9cf083
parentcf3b6416c45c0d7ecb5cf4c3e989244fc3a906d2 (diff)
downloadphp-git-d58b3869a71e83032874d4feacccea8985bdc53a.tar.gz
Fixed bug #38377 (session_destroy() gives warning after
session_regenerate_id()).
-rw-r--r--NEWS2
-rw-r--r--ext/session/mod_files.c7
-rw-r--r--ext/session/tests/bug38377.phpt13
3 files changed, 21 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 8561265803..d32738ebc5 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,8 @@ PHP NEWS
- Fixed phpinfo() cutoff of variables at \0. (Ilia)
- Fixed a bug in the filter extension that prevented magic_quotes_gpc from
being applied when RAW filter is used. (Ilia)
+- Fixed bug #38377 (session_destroy() gives warning after
+ session_regenerate_id()). (Ilia)
- Fixed bug #38354 (Unwanted reformatting of XML when using AsXML). (Christian)
- Fixed bug #38347 (Segmentation fault when using foreach with an unknown/empty
SimpleXMLElement). (Tony)
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index c4ae79310c..c72997e2c6 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -402,7 +402,12 @@ PS_DESTROY_FUNC(files)
ps_files_close(data);
if (VCWD_UNLINK(buf) == -1) {
- return FAILURE;
+ /* This is a little safety check for instances when we are dealing with a regenerated session
+ * that was not yet written to disk
+ */
+ if (!VCWD_ACCESS(buf, F_OK)) {
+ return FAILURE;
+ }
}
}
diff --git a/ext/session/tests/bug38377.phpt b/ext/session/tests/bug38377.phpt
new file mode 100644
index 0000000000..514e459637
--- /dev/null
+++ b/ext/session/tests/bug38377.phpt
@@ -0,0 +1,13 @@
+--TEST--
+bug #38377 (session_destroy() gives warning after session_regenerate_id())
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+session_start();
+session_regenerate_id();
+session_destroy();
+echo "Done\n";
+?>
+--EXPECT--
+Done