diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2006-08-08 14:57:33 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2006-08-08 14:57:33 +0000 |
| commit | 936ebdbe1f747fd0999acde3e7c995d8a12f7d31 (patch) | |
| tree | 3493448477b132ece3188a286308c1b3e43d2429 | |
| parent | a9a858d7adf7ce577585cf00eab408b1a13215ec (diff) | |
| download | php-git-936ebdbe1f747fd0999acde3e7c995d8a12f7d31.tar.gz | |
MFB: Fixed bug #38377 (session_destroy() gives warning after
session_regenerate_id()).
| -rw-r--r-- | ext/session/mod_files.c | 7 | ||||
| -rw-r--r-- | ext/session/tests/bug38377.phpt | 13 |
2 files changed, 19 insertions, 1 deletions
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 |
