CC: | srezic [...] iconmobile.com |
Subject: | Paranoid::Lockfile: should check return value of flock call |
Reading the source code of Paranoid::Lockfile I saw that flock() and
sysopen() are used without checking the return value. This can lead to
error conditions. To simulate one, chown a lockfile to some other user
and the try to use Paranoid::Lockfile with this lockfile. There will be
a warning like this:
flock() on closed filehandle $fd at
/usr/perl5.12.0/lib/site_perl/5.12.0/Paranoid/Lockfile.pm line 127.
and plock() would still return a success value, without doing any real
locking.
Regards,
Slaven