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