1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
<?php
/* Some basic checks are in place */
isset($r) || die("CVSroot must be set\n");
isset($m) || die("CVSmodule must be set\n");
isset($f) || die("File must be set\n");
if(strchr($r, "'") || strchr($m, "'") || strchr($f, "'"))
die("Invalid characters in arguments\n");
/* I'll be paranoid, set root and module here so no one can get access elsewhere */
/* Remove this or change it to suit your needs */
// $r = "/home/cvsgraph";
// $m = "cvsgraph";
/* Shell escape, PHP4 has functions for this, use them */
$r = "'" . $r . "'";
$m = "'" . $m . "'";
$f = "'" . $f . ",v'";
/* I expose the paths here (accessible via the server). */
/* Set this to a private place to make it secure. */
$prefix = "@prefix@";
$exec_prefix = "@exec_prefix@";
$cvsgraph = "@bindir@/cvsgraph";
$cvsgraph_conf = "@sysconfdir@/cvsgraph.conf";
/* Default I generate PNG */
Header("Content-Type: image/png");
passthru("$cvsgraph -q -c $cvsgraph_conf -r $r -m $m $f");
?>
|