version 1.1.1.26, 2001/06/05 10:56:15 |
version 1.1.1.27, 2001/07/06 09:54:57 |
|
|
# 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.106 2001/03/10 01:16:27 hnordstrom Exp $ |
# $zId: cvsweb.cgi,v 1.110 2001/06/29 09:29:36 hnordstrom Exp $ |
# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.74 2001/06/05 04:46:21 knu Exp $ |
# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.78 2001/07/06 09:49:01 knu Exp $ |
# |
# |
### |
### |
|
|
|
|
$tabstop $state $annTable $sel $curbranch @HideModules |
$tabstop $state $annTable $sel $curbranch @HideModules |
$module $use_descriptions %descriptions @mytz $dwhere $moddate |
$module $use_descriptions %descriptions @mytz $dwhere $moddate |
$use_moddate $has_zlib $gzip_open |
$use_moddate $has_zlib $gzip_open |
$allow_tar @tar_options @gzip_options @cvs_options |
$allow_tar @tar_options @gzip_options @zip_options @cvs_options |
$LOG_FILESEPARATOR $LOG_REVSEPARATOR |
$LOG_FILESEPARATOR $LOG_REVSEPARATOR |
); |
); |
|
|
Line 139 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(/ /, |
$cvsweb_revision = '1.110' . '.' . (split(/ /, |
q$Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.74 2001/06/05 04:46:21 knu Exp $ |
q$Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.78 2001/07/06 09:49:01 knu Exp $ |
))[2]; |
))[2]; |
|
|
use File::Basename; |
use File::Basename; |
Line 170 $allow_version_select = 1; |
|
Line 170 $allow_version_select = 1; |
|
# These are defined to allow checking with perl -cw |
# These are defined to allow checking with perl -cw |
@CVSrepositories = @CVSROOT = %CVSROOT = |
@CVSrepositories = @CVSROOT = %CVSROOT = |
%MIRRORS = %DEFAULTVALUE = %ICONS = %MTYPES = |
%MIRRORS = %DEFAULTVALUE = %ICONS = %MTYPES = |
%tags = %alltags = @tabcolors = (); |
%tags = %alltags = @tabcolors = %fileinfo = (); |
$cvstreedefault = $body_tag = $body_tag_for_src = |
$cvstreedefault = $body_tag = $body_tag_for_src = |
$logo = $defaulttitle = $address = |
$logo = $defaulttitle = $address = |
$long_intro = $short_instruction = $shortLogLen = |
$long_intro = $short_instruction = $shortLogLen = |
Line 518 if ($input{tarball}) { |
|
Line 518 if ($input{tarball}) { |
|
&fatal("403 Forbidden", "Downloading tarballs is prohibited.") |
&fatal("403 Forbidden", "Downloading tarballs is prohibited.") |
unless $allow_tar; |
unless $allow_tar; |
my($module) = ($where =~ m,^/?(.*),); # untaint |
my($module) = ($where =~ m,^/?(.*),); # untaint |
$module =~ s,/[^/]*$,,; |
$module =~ s,/([^/]*)$,,; |
|
my($ext) = ($1 =~ /(\.tar\.gz|\.zip)$/); |
my($basedir) = ($module =~ m,([^/]+)$,); |
my($basedir) = ($module =~ m,([^/]+)$,); |
|
|
if ($basedir eq '' || $module eq '') { |
if ($basedir eq '' || $module eq '') { |
Line 530 if ($input{tarball}) { |
|
Line 531 if ($input{tarball}) { |
|
mkdir($tmpdir, 0700) |
mkdir($tmpdir, 0700) |
or &fatal("500 Internal Error", "Unable to make temporary directory: $!"); |
or &fatal("500 Internal Error", "Unable to make temporary directory: $!"); |
|
|
my $fatal = ''; |
my @fatal; |
|
|
while (1) { |
my $tag = (exists $input{only_with_tag} && length $input{only_with_tag}) |
my $tag = (exists $input{only_with_tag} && length $input{only_with_tag}) |
? $input{only_with_tag} : "HEAD"; |
? $input{only_with_tag} : "HEAD"; |
|
|
|
system $CMD{cvs}, @cvs_options, '-Qd', $cvsroot, 'export', '-r', $tag, '-d', "$tmpdir/$basedir", $module |
if (system $CMD{cvs}, @cvs_options, '-Qd', $cvsroot, 'export', '-r', $tag, '-d', "$tmpdir/$basedir", $module) { |
and $fatal = "500 Internal Error","cvs co failure: $!: $module" |
@fatal = ("500 Internal Error", "cvs co failure: $!: $module"); |
&& last; |
} else { |
|
|
$| = 1; # Essential to get the buffering right. |
$| = 1; # Essential to get the buffering right. |
|
|
print "Content-type: application/x-gzip\r\n\r\n"; |
if ($ext eq '.tar.gz') { |
|
print "Content-type: application/x-gzip\r\n\r\n"; |
|
|
system "$CMD{tar} @tar_options -cf - -C $tmpdir $basedir | $CMD{gzip} @gzip_options -c" |
system "$CMD{tar} @tar_options -cf - -C $tmpdir $basedir | $CMD{gzip} @gzip_options -c" |
and $fatal = "500 Internal Error","tar zc failure: $!: $basedir" |
and @fatal = ("500 Internal Error", "tar zc failure: $!: $basedir"); |
&& last; |
} elsif ($ext eq '.zip' && $CMD{zip}) { |
|
print "Content-type: application/zip\r\n\r\n"; |
|
|
last; |
system "cd $tmpdir && $CMD{zip} @zip_options -r - $basedir" |
|
and @fatal = ("500 Internal Error", "zip failure: $!: $basedir"); |
|
} else { |
|
@fatal = ("500 Internal Error", "unsupported file type"); |
|
} |
} |
} |
|
|
system $CMD{rm}, '-rf', $tmpdir if -d $tmpdir; |
system $CMD{rm}, '-rf', $tmpdir if -d $tmpdir; |
|
|
&fatal($fatal) if $fatal; |
&fatal(@fatal) if @fatal; |
|
|
exit; |
exit; |
} |
} |
Line 908 if (-d $fullname) { |
|
Line 913 if (-d $fullname) { |
|
|
|
if (defined($basefile) && $basefile ne '') { |
if (defined($basefile) && $basefile ne '') { |
print "<HR NOSHADE>\n", |
print "<HR NOSHADE>\n", |
"<DIV align=center>", |
"<DIV align=center>Download this directory in "; |
&link("Download this directory in tarball", |
# Mangle the filename so browsers show a reasonable |
# Mangle the filename so browsers show a reasonable |
# filename to download. |
# filename to download. |
print &link("tarball", |
"./$basefile.tar.gz$query". |
"./$basefile.tar.gz$query". |
($query ? "&" : "?")."tarball=1"), |
($query ? "&" : "?")."tarball=1"); |
"</DIV>"; |
if ($CMD{zip}) { |
|
print " or ", |
|
&link("zip archive", |
|
"./$basefile.zip$query". |
|
($query ? "&" : "?")."tarball=1"); |
|
} |
|
print "</DIV>"; |
} |
} |
} |
} |
|
|
Line 1319 sub search_path($) { |
|
Line 1330 sub search_path($) { |
|
return "$d/$command" if -x "$d/$command"; |
return "$d/$command" if -x "$d/$command"; |
} |
} |
|
|
$command; |
''; |
} |
} |
|
|
sub getMimeTypeFromSuffix($) { |
sub getMimeTypeFromSuffix($) { |
Line 1622 sub doCheckout($$) { |
|
Line 1633 sub doCheckout($$) { |
|
|
|
# Parse CVS header |
# Parse CVS header |
my ($revision, $filename, $cvsheader); |
my ($revision, $filename, $cvsheader); |
|
$filename = ""; |
while(<$fh>) { |
while(<$fh>) { |
last if (/^\*\*\*\*/); |
last if (/^\*\*\*\*/); |
$revision = $1 if (/^VERS: (.*)$/); |
$revision = $1 if (/^VERS: (.*)$/); |