[Tickets #12557] File based SessionHandler: Fix unlikely data corruption due to file creation race

noreply at bugs.horde.org noreply at bugs.horde.org
Sat Aug 10 12:06:48 UTC 2013


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/12557
------------------------------------------------------------------------------
  Ticket             | 12557
  Created By         | Thomas Jarosch <thomas.jarosch at intra2net.com>
  Summary            | File based SessionHandler: Fix unlikely data corruption
                     | due  to file creation race
  Queue              | Horde Framework Packages
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              | 1
  Owners             |
------------------------------------------------------------------------------


Thomas Jarosch <thomas.jarosch at intra2net.com> (2013-08-10 12:06) wrote:

 From the patch:

There is a small time window between is_readable() returns true
and another process creates the file at the same time.
    -> we would truncate the data of the other process.

Fix it by using 'c+' fopen() mode which is available since PHP 5.2.6.
(Minimum PHP version for Horde is 5.3.0)

For those interested in the details of the PHP open modes, look for the
     PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags)
function in the PHP source code.




Thomas Jarosch <thomas.jarosch at intra2net.com> (2013-08-10 12:06)  
uploaded:  
0001-File-based-SessionHandler-Fix-unlikely-data-corrupti.patch

http://bugs.horde.org/h/services/download/?app=whups&actionID=download_file&file=0001-File-based-SessionHandler-Fix-unlikely-data-corrupti.patch&ticket=12557&fn=%2F0001-File-based-SessionHandler-Fix-unlikely-data-corrupti.patch





More information about the bugs mailing list