[ic] was Design Error, now temporary fix for Perl 5.8.0 / internal Server Error 500 / Could not lock file

Frederic Steinfels interchange-users@icdevgroup.org
Mon Mar 17 02:22:00 2003


After doing some investigations in IC, I found out where those Error 
messages are coming from.
I made a fix for it that works for me. THIS FIX IS VERY PROBLEMATIC.

Basically the flock command fails for an UNKNOWN reason. What I did is 
basically putting
the flock command into an endless loop making sure the loop is not 
finished before the
flock is successul. This loop has no other break condition.

This could very vell make your IC vulnerable to denial of service attack 
or make it lock
up under certain conditions.

Read the patch man page to find out how to install it.

--- Util.pm.orig        2002-12-16 11:03:39.000000000 +0100
+++ Util.pm     2003-03-11 23:06:08.000000000 +0100
@@ -1384,7 +1385,10 @@
     my $flag = $excl ? $flock_LOCK_EX : $flock_LOCK_SH;

     if ($wait) {
-        flock($fh, $flag) or die "Could not lock file: $!\n";
+        while(!flock($fh, $flag))
+        {
+               ::logError("Could not lock file!");
+        }
         return 1;
     }
     else {