Hello,

I think I found a bug in mon.cgi when run under Apache/modperl.

It's about the views, and the cookie used to store it between
requests. When several users are viewing the same page, the vcookie is
reset to the last value requested (by setview) or seen by a user. It's
because the vcookie is not always set explicitely, and because of
modperl, its value is persistent between requests.

Here is the patch to correct this:

--- mon.cgi-old 2007-02-05 17:45:03.181101800 +0100
+++ mon.cgi     2007-02-05 17:45:58.636711100 +0100
@@ -2176,16 +2176,17 @@
     print STDERR "list_views failed" if ($c->error);
     $viewreq = $webpage->param(-name=>"setview");
     if ($viewreq && ($viewreq eq '--all--' || grep(/^$viewreq$/, @views))) {
-       $vcookie = $webpage->cookie(-name=>"$vcookie_name",
-                                   -value=>"$viewreq",
-                                   -expires=>"+1y",
-                                   -path=>"$vcookie_path",
-                                  );
        $curview = $viewreq;
     } else {
        $curview = $webpage->cookie(-name=>"$vcookie_name");
     }

+    $vcookie = $webpage->cookie(-name=>"$vcookie_name",
+                               -value=>"$curview",
+                               -expires=>"+1y",
+                               -path=>"$vcookie_path",
+                               );
+
     if ($curview && $curview ne '--all--') {
        $c->setview($curview);
     }


Hope this helps a little bit,
-- 
Nicolas

_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to