Mailinglist Archive: opensuse-factory (487 mails)

< Previous Next >
[opensuse-factory] Watch out PHP changes
  • From: Cristian Rodríguez <crrodriguez@xxxxxxxxxxxx>
  • Date: Wed, 12 May 2010 12:58:48 -0400
  • Message-id: <4BEADE48.5020008@xxxxxxxxxxxx>
Hi:

In the next security updates as well in openSUSE factory PHP no longer
release the lock of previously locked files, neither automagically at
shutdown nor at stream closing so (broken) code like:

<?php

$fp = fopen('foo.txt','wb');
flock($fp, LOCK_EX);
/* write or do whatever with the locked file... */
fclose($fp);
?>

Will no longer "unlock" the file in question.

This is an upstream change to provide a sane/correct behaviour from now
on but it might cause subtle issues.

So, you have to explicetely flock($fp,LOCK_UN); before closing the file.


Just keep an eye on this.

Cheers.
Cristian.


--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-factory+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages