From: Ilia Alshanetsky Date: Tue, 8 Aug 2006 14:57:04 +0000 (+0000) Subject: MFH: Fixed bug #38377 (session_destroy() gives warning after X-Git-Tag: php-4.4.4RC1~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7d18bdcab1c26a0f95af4fbd76517fb1317ee05;p=php MFH: Fixed bug #38377 (session_destroy() gives warning after session_regenerate_id()). --- diff --git a/NEWS b/NEWS index 713b739d75..cd84e755ff 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP 4 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2006, Version 4.4.4 +- Fixed bug #38377 (session_destroy() gives warning after + session_regenerate_id()). (Ilia) - Fixed bug #38322 (reading past array in sscanf() leads to arbitary code execution). (Tony) - Fixed bug #38278 (session_cache_expire()'s value does not match phpinfo's diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 06af01a13d..e1485d586e 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -368,7 +368,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-- + +--FILE-- + +--EXPECT-- +Done