Package: php4-rrdtool
Version: 1.04-10
Severity: important


Hello,


seems the last upload of php4-rrdtool has a problem in function rrd_graph getting the actual base path and uses / instead. Please also see Bug #296193. amavis-stats gives a relative path to the function that worked up to the last upload and now tries to write to /. Maybe the problem comes from the last php upload itself, amavis-stats wasn't changed for months.


I'll send this as a php4-rrdtool bug report, cc goes to amavis-stats #296193.


Best regards, René


Fast and dirty workaround for amavis-stats until php is fixed (also includes a patch to work with php safe_mode exec('hostname')):


--- amavis-stats.php.orig        2004-08-12 08:51:09.000000000 +0200
+++ amavis-stats.php    2005-03-02 00:52:19.000000000 +0100
@@ -473,7 +473,7 @@
    }

    if ($host == "") {
-        $host = eregi_replace("\n", "", `hostname`);
+        $host = eregi_replace("\n", "", exec('hostname'));
    }


@@ -648,7 +648,7 @@ $opts[] = "COMMENT:$enddate \\r";

    asDbg($opts);
-    $ret = rrd_graph($img, $opts, count($opts));
+    $ret = rrd_graph("/usr/share/amavis-stats/$img" , $opts, count($opts));

    if (!is_array($ret)) {
        $err = rrd_error();
@@ -698,7 +698,7 @@
    }

    if ($host == "") {
-        $host = eregi_replace("\n", "", `hostname`);
+        $host = eregi_replace("\n", "", exec('hostname'));
    }

    if ($rate == 3600) {
@@ -716,7 +716,7 @@
    $opts[] = "--vertical-label=msgs/$ratemsg";

$arr = array($pid, $psid, $bid, $iid, $nid, $nsid);
- $arrcol = array("6A5ACD", "fA5ACD", "cc9900", "ffdd00", "9900aa", "ff3a3d");
+ $arrcol = array("00ff00", "fA5ACD", "ff0000", "ffff00", "0000ff", "ff3a3d");


    $type = "AREA";
    foreach ($arr as $idx => $id) {
@@ -777,7 +777,7 @@
    asDbg($opts);

    $start = microtime();
-    $ret = rrd_graph($img, $opts, count($opts));
+    $ret = rrd_graph("/usr/share/amavis-stats/$img" , $opts, count($opts));
    $t = elapsed($start);
    if (!is_array($ret)) {
        $err = rrd_error();





--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Reply via email to