Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Apr 2001 12:10:49 -0700 (PDT)
From:      dhw@whistle.com
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        david@catwhisker.org
Subject:   ports/26851: Buglet in cvsweb
Message-ID:  <200104251910.f3PJAnR41838@pau-amma.whistle.com>

next in thread | raw e-mail | index | archive | help

>Number:         26851
>Category:       ports
>Synopsis:       Buglet breaks cvsweb in Perl5 environment
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 25 12:20:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     David Wolfskill
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
Whistle Communications
>Environment:
System: FreeBSD m147.whistle.com 4.3-STABLE FreeBSD 4.3-STABLE #30: Wed Apr 25 06:43:02 PDT 2001 root@dhcp-140.catwhisker.org:/common/S1/obj/usr/src/sys/LAPTOP_30W i386

	Perl 5.005_03; versions of cvsweb since early March (probably
	earlier).

>Description:

	In Perl5, the construct found on line 1109 of cvsweb.cgi (in
	htmlify_sub) that reads "local @_" is not valid.

	Its use causes an unpatched cvsweb invocation to generate a page
	that reads:

Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, you@your.address and inform
them of the time the error occurred, and anything you might have
done that may have caused the error.

More information about this error may be available in the server error
log.


Apache/1.3.19 Server at m147.whistle.com Port 80


	accompanied by a pair of lines appended to the Apache error log
	(/var/tmp/httpd-error.log):


Can't localize lexical variable @_ at /usr/local/www/cgi-bin/cvsweb.cgi line 1109.
[Wed Apr 25 10:45:45 2001] [error] [client 127.0.0.1] Premature end of script headers: /usr/local/www/cgi-bin/cvsweb.cgi


>How-To-Repeat:

	Install /usr/ports/devel/cvsweb on a system where the Perl
	interpreter runs Perl 5.005_03.  Then try to use it.

>Fix:

	The issue is that "local @_" is not valid.  So what I've done
	(since early March... and re-doing every time I upgrade cvsweb)
	is depicted by the following patch:

--- /usr/ports/devel/cvsweb/work/cvsweb/cvsweb.cgi	Wed Apr 25 10:40:40 2001
+++ cvsweb.cgi	Wed Apr 25 11:15:10 2001
@@ -87,6 +87,7 @@
     $use_moddate $has_zlib $gzip_open
     $allow_tar @tar_options @gzip_options @cvs_options
     $LOG_FILESEPARATOR $LOG_REVSEPARATOR
+    @h
 );
 
 sub printDiffSelect($);
@@ -1106,11 +1107,11 @@
 
 sub htmlify_sub(&$) {
     (my $proc, local $_) = @_;
-    local @_ = split(m`(<a [^>]+>[^<]*</a>)`i);
+    local @h = split(m`(<a [^>]+>[^<]*</a>)`i);
     my $linked;
     my $result = '';
 
-    while (($_, $linked) = splice(@_, 0, 2)) {
+    while (($_, $linked) = splice(@h, 0, 2)) {
 	&$proc();
 	$result .= $_ if defined($_);
 	$result .= $linked if defined($linked);
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104251910.f3PJAnR41838>