From owner-freebsd-ports Wed Apr 25 12:20:24 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 95F6037B423 for ; Wed, 25 Apr 2001 12:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f3PJK2t32055; Wed, 25 Apr 2001 12:20:02 -0700 (PDT) (envelope-from gnats) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (Postfix) with ESMTP id CAED437B496 for ; Wed, 25 Apr 2001 12:11:16 -0700 (PDT) (envelope-from dhw@whistle.com) Received: (from smap@localhost) by whistle.com (8.10.0/8.10.0) id f3PJBGW18243; Wed, 25 Apr 2001 12:11:16 -0700 (PDT) Received: from pau-amma.whistle.com( 207.76.205.64) by whistle.com via smap (V2.0) id xma018239; Wed, 25 Apr 2001 12:10:49 -0700 Received: (from dhw@localhost) by pau-amma.whistle.com (8.11.1/8.11.1) id f3PJAnR41838; Wed, 25 Apr 2001 12:10:49 -0700 (PDT) Message-Id: <200104251910.f3PJAnR41838@pau-amma.whistle.com> Date: Wed, 25 Apr 2001 12:10:49 -0700 (PDT) From: dhw@whistle.com Reply-To: dhw@whistle.com To: FreeBSD-gnats-submit@freebsd.org Cc: david@catwhisker.org X-Send-Pr-Version: 3.2 Subject: ports/26851: Buglet in cvsweb Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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`(]+>[^<]*)`i); + local @h = split(m`(]+>[^<]*)`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