version 1.1.1.21, 2001/01/12 04:17:16 |
version 1.1.1.23, 2001/03/22 19:52:43 |
|
|
# Copyright (c) 1996-1998 Bill Fenner |
# Copyright (c) 1996-1998 Bill Fenner |
# (c) 1998-1999 Henner Zeller |
# (c) 1998-1999 Henner Zeller |
# (c) 1999 Henrik Nordstrom |
# (c) 1999 Henrik Nordstrom |
# (c) 2000 Akinori MUSHA |
# (c) 2000-2001 Akinori MUSHA |
# All rights reserved. |
# All rights reserved. |
# |
# |
# Redistribution and use in source and binary forms, with or without |
# Redistribution and use in source and binary forms, with or without |
|
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# SUCH DAMAGE. |
# SUCH DAMAGE. |
# |
# |
# $zId: cvsweb.cgi,v 1.104 2000/11/01 22:05:12 hnordstrom Exp $ |
# $zId: cvsweb.cgi,v 1.106 2001/03/10 01:16:27 hnordstrom Exp $ |
# $kId: cvsweb.cgi,v 1.63 2001/01/11 23:42:01 knu Exp $ |
# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.68 2001/03/22 19:46:59 knu Exp $ |
# |
# |
### |
### |
|
|
|
|
use strict; |
use strict; |
|
|
use vars qw ( |
use vars qw ( |
|
$cvsweb_revision |
$mydir $uname $config $allow_version_select $verbose |
$mydir $uname $config $allow_version_select $verbose |
@CVSrepositories @CVSROOT %CVSROOT %CVSROOTdescr |
@CVSrepositories @CVSROOT %CVSROOT %CVSROOTdescr |
%MIRRORS %DEFAULTVALUE %ICONS %MTYPES |
%MIRRORS %DEFAULTVALUE %ICONS %MTYPES |
Line 138 sub forbidden_module($); |
|
Line 139 sub forbidden_module($); |
|
##### Start of Configuration Area ######## |
##### Start of Configuration Area ######## |
delete $ENV{PATH}; |
delete $ENV{PATH}; |
|
|
|
$cvsweb_revision = '1.106' . '.' . (split(/ /, |
|
q$Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.68 2001/03/22 19:46:59 knu Exp $ |
|
))[2]; |
|
|
use File::Basename; |
use File::Basename; |
|
|
($mydir) = (dirname($0) =~ /(.*)/); # untaint |
($mydir) = (dirname($0) =~ /(.*)/); # untaint |
Line 248 $where =~ s|^/||; |
|
Line 253 $where =~ s|^/||; |
|
$scriptname = defined($ENV{SCRIPT_NAME}) ? $ENV{SCRIPT_NAME} : ''; |
$scriptname = defined($ENV{SCRIPT_NAME}) ? $ENV{SCRIPT_NAME} : ''; |
$scriptname =~ s|^/*|/|; |
$scriptname =~ s|^/*|/|; |
|
|
# Let's workaround thttpd's stupidness.. |
# Let's workaround thttpd's stupidity.. |
if ($scriptname =~ m|/$|) { |
if ($scriptname =~ m|/$|) { |
$pathinfo .= '/'; |
$pathinfo .= '/'; |
my $re = quotemeta $pathinfo; |
my $re = quotemeta $pathinfo; |
Line 304 if (-f $config) { |
|
Line 309 if (-f $config) { |
|
} else { |
} else { |
&fatal("500 Internal Error", |
&fatal("500 Internal Error", |
'Configuration not found. Set the variable <code>$config</code> ' |
'Configuration not found. Set the variable <code>$config</code> ' |
. 'in cvsweb.cgi, or the environment variable ' |
. 'in cvsweb.cgi to your <b>cvsweb.conf</b> configuration file first.'); |
. '<code>CVSWEB_CONFIG</code>, to your <b>cvsweb.conf</b> ' |
|
. 'configuration file first.'); |
|
} |
} |
|
|
undef %input; |
undef %input; |
Line 733 if (-d $fullname) { |
|
Line 736 if (-d $fullname) { |
|
|
|
if ($_ eq '..' || -d "$fullname/$_") { |
if ($_ eq '..' || -d "$fullname/$_") { |
next if ($_ eq '..' && $where eq '/'); |
next if ($_ eq '..' && $where eq '/'); |
my ($rev,$date,$log,$author,$filename) = @{$fileinfo{$_}} |
my ($rev,$date,$log,$author,$filename); |
|
($rev,$date,$log,$author,$filename) = @{$fileinfo{$_}} |
if (defined($fileinfo{$_})); |
if (defined($fileinfo{$_})); |
printf '<tr bgcolor="%s"><td>', $tabcolors[$dirrow % 2] if $dirtable; |
printf '<tr bgcolor="%s"><td>', $tabcolors[$dirrow % 2] if $dirtable; |
if ($_ eq '..') { |
if ($_ eq '..') { |
Line 1222 sub spacedHtmlText($;$) { |
|
Line 1226 sub spacedHtmlText($;$) { |
|
sub link($$) { |
sub link($$) { |
my($name, $url) = @_; |
my($name, $url) = @_; |
|
|
|
$url =~ s/:/sprintf("%%%02x", ord($&))/eg; |
|
|
sprintf '<A HREF="%s">%s</A>', hrefquote($url), $name; |
sprintf '<A HREF="%s">%s</A>', hrefquote($url), $name; |
} |
} |
|
|
Line 1299 sub safeglob($) { |
|
Line 1305 sub safeglob($) { |
|
push(@results, "$dirname/" .$_); |
push(@results, "$dirname/" .$_); |
} |
} |
} |
} |
|
closedir($dh); |
} |
} |
|
|
@results; |
@results; |
Line 1407 sub doAnnotate($$) { |
|
Line 1414 sub doAnnotate($$) { |
|
# the public domain. |
# the public domain. |
# we could abandon the use of rlog, rcsdiff and co using |
# we could abandon the use of rlog, rcsdiff and co using |
# the cvsserver in a similiar way one day (..after rewrite) |
# the cvsserver in a similiar way one day (..after rewrite) |
$pid = open2($reader, $writer, "cvs", @cvs_options, "server") |
$pid = open2($reader, $writer, $CMD{cvs}, @cvs_options, "server") |
|| fatal ("500 Internal Error", "Fatal Error - unable to open cvs for annotation"); |
|| fatal ("500 Internal Error", "Fatal Error - unable to open cvs for annotation"); |
|
|
# OK, first send the request to the server. A simplified example is: |
# OK, first send the request to the server. A simplified example is: |
Line 2634 sub human_readable_diff($){ |
|
Line 2641 sub human_readable_diff($){ |
|
print "<br>Tag: $sym2\n" if ($sym1); |
print "<br>Tag: $sym2\n" if ($sym1); |
print "</th>\n"; |
print "</th>\n"; |
|
|
my $fs = "<font face=\"$difffontface\" size=\"$difffontsize\">"; |
my $fs = "<font face=\"$difffontface\" size=\"$difffontsize\"><tt>"; |
my $fe = "</font>"; |
my $fe = "</tt></font>"; |
|
|
my $leftRow = 0; |
my $leftRow = 0; |
my $rightRow = 0; |
my $rightRow = 0; |
Line 2752 sub navigateHeader($$$$$) { |
|
Line 2759 sub navigateHeader($$$$$) { |
|
my ($swhere,$path,$filename,$rev,$title) = @_; |
my ($swhere,$path,$filename,$rev,$title) = @_; |
$swhere = "" if ($swhere eq $scriptwhere); |
$swhere = "" if ($swhere eq $scriptwhere); |
$swhere = urlencode($filename) if ($swhere eq ""); |
$swhere = urlencode($filename) if ($swhere eq ""); |
print qq`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">`; |
|
print "<HTML>\n<HEAD>\n"; |
print <<EOF; |
print qq`<META name="robots" content="nofollow">\n`; |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
print '<!-- CVSweb $zRevision: 1.104 $ $kRevision: 1.63 $ -->'; |
<HTML> |
print "\n<TITLE>$path$filename - $title - $rev</TITLE></HEAD>\n"; |
<HEAD> |
print "$body_tag_for_src\n"; |
<META name="robots" content="nofollow"> |
print "<table width=\"100%\" border=0 cellspacing=0 cellpadding=1 bgcolor=\"$navigationHeaderColor\">"; |
<!-- knu-cvsweb $cvsweb_revision --> |
print "<tr valign=bottom><td>"; |
<TITLE>$path$filename - $title - $rev</TITLE></HEAD> |
|
$body_tag_for_src |
|
<table width="100%" border=0 cellspacing=0 cellpadding=1 bgcolor="$navigationHeaderColor"> |
|
<tr valign=bottom><td> |
|
EOF |
|
|
print &link($backicon, "$swhere$query#rev$rev"); |
print &link($backicon, "$swhere$query#rev$rev"); |
print "</a> <b>Return to ", &link("$filename","$swhere$query#rev$rev")," CVS log"; |
print "</a> <b>Return to ", &link("$filename","$swhere$query#rev$rev")," CVS log"; |
print "</b> $fileicon</td>"; |
print "</b> $fileicon</td>"; |
Line 2970 sub download_url($$;$) { |
|
Line 2982 sub download_url($$;$) { |
|
$url .= "?rev=$revision"; |
$url .= "?rev=$revision"; |
$url .= '&content-type=' . urlencode($mimetype) if (defined($mimetype)); |
$url .= '&content-type=' . urlencode($mimetype) if (defined($mimetype)); |
|
|
|
$url =~ s/:/sprintf("%%%02x", ord($&))/eg; |
|
|
$url; |
$url; |
} |
} |
|
|
Line 3150 sub http_header(;$) { |
|
Line 3164 sub http_header(;$) { |
|
|
|
sub html_header($) { |
sub html_header($) { |
my ($title) = @_; |
my ($title) = @_; |
my $version = '$zRevision: 1.104 $ $kRevision: 1.63 $'; #' |
|
http_header("text/html"); |
http_header("text/html"); |
print <<EOH; |
print <<EOH; |
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" |
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" |
Line 3159 sub html_header($) { |
|
Line 3172 sub html_header($) { |
|
<head> |
<head> |
<meta name="robots" content="nofollow"> |
<meta name="robots" content="nofollow"> |
<title>$title</title> |
<title>$title</title> |
<!-- CVSweb $version --> |
<!-- knu-cvsweb $cvsweb_revision --> |
</head> |
</head> |
$body_tag |
$body_tag |
$logo <h1 align="center">$title</h1> |
$logo <h1 align="center">$title</h1> |