Sorry if this is already known, or if I'm posting to the wrong
people, (I'm new to the mod_perl world), but :

Looks like there's a minor bug in Apache::Session::Lock::File::clean().
Patch : (against version 1.01, in distribution Apache-Session-1.54)
(also adding proper local()ization of handles)


--- Apache/Session/Lock/File.pm.orig    Sat Sep  2 00:21:17 2000
+++ Apache/Session/Lock/File.pm Thu Apr 25 15:45:18 2002
@@ -129,11 +129,14 @@

      my $now = time();

+    local *DIR;
+    local *FH;
+
      opendir(DIR, $dir) || die $!;
      my @files = readdir(DIR);
      foreach my $file (@files) {
          if ($file =~ /^Apache-Session.*\.lock$/) {
-            if ((stat($dir.'/'.$file))[8] - $now >= $time) {
+            if ($now - (stat($dir.'/'.$file))[8] >= $time) {
                  open(FH, "+>$dir/".$file) || next;
                  flock(FH, LOCK_EX) || next;
                  unlink($dir.'/'.$file) || next;
End of Patch.


-- 
Rafael Garcia-Suarez -- http://rgarciasuarez.free.fr/
  http://lyon.pm.org/ -- http://cpan.org/authors/id/R/RG/RGARCIA/
                      -- http://use.perl.org/~rafael/

Reply via email to