Date: Sat, 26 May 2001 00:20:46 -0700 (PDT) From: arun@sharmas.dhs.org To: freebsd-gnats-submit@freebsd.org Subject: docs/27654: Update to PR 27653 Message-ID: <200105260720.f4Q7KkV01069@sharmas.dhs.org>
next in thread | raw e-mail | index | archive | help
>Number: 27654 >Category: docs >Synopsis: Update to PR 27653 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat May 26 00:30:04 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Arun Sharma >Release: 5.0 current >Organization: >Environment: >Description: The patch attached in PR 27653 was corrupted due to a bug in the patch itself. >How-To-Repeat: Use the attached patch. If it applies cleanly, it proves that the patch works. >Fix: ------------=_990861646-1068-0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: text/plain --- dosendpr.cgi 2001/05/24 04:21:13 1.1 +++ dosendpr.cgi 2001/05/26 07:17:12 @@ -9,9 +9,16 @@ # (http://www.gnu.ai.mit.edu/copyleft/gpl.html) # # $FreeBSD: www/en/cgi/dosendpr.cgi,v 1.5 2001/05/07 19:28:09 wosch Exp $ +# +# MIME support: Arun Sharma <arun@sharmas.dhs.org> require "html.pl"; +# Requires p5-MIME-Tools port +use CGI qw(:standard); +use MIME::Entity; +use IO::String; + sub prerror { &html_title ("Problem Report Error"); &html_body(); @@ -23,9 +30,11 @@ } &www_content ("text","html"); -&cgi_form_in(); +#&cgi_form_in(); + +$query = CGI::new; -$gndb = $cgi_data{'gndb'}; +$gndb = $query->param('gndb'); if ($gndb =~ /^[a-z]+$/ && -e "$gndb.def") { require "$gndb.def"; } else @@ -52,8 +61,8 @@ &html_body ($gnsprepbody); # Verify the data ... -if (!$cgi_data{'email'} || !$cgi_data{'originator'} || - !$cgi_data{'synopsis'}) { +if (!$query->param('email') || !$query->param('originator') || + !$query->param('synopsis')) { if ($gnsprepbad && -e $gnsprepbad ) { print `cat $gnsprepbad`; } else { @@ -68,27 +77,67 @@ } # Build the PR. -$pr = "To: $gnemail\n" . - "From: $cgi_data{'email'}\n" . - "Subject: $cgi_data{'synopsis'}\n" . - "X-Send-Pr-Version: www-1.0\n\n" . - ">Submitter-Id:\t$cgi_data{'submitterid'}\n" . - ">Originator:\t$cgi_data{'originator'}\n" . - ">Organization:\t$cgi_data{'organization'}\n" . - ">Confidential:\t$cgi_data{'confidential'}\n" . - ">Synopsis:\t$cgi_data{'synopsis'}\n" . - ">Severity:\t$cgi_data{'severity'}\n" . - ">Priority:\t$cgi_data{'priority'}\n" . - ">Category:\t$cgi_data{'category'}\n" . - ">Class:\t\t$cgi_data{'class'}\n" . - ">Release:\t$cgi_data{'release'}\n" . - ">Environment:\t$cgi_data{'environment'}\n" . - ">Description:\n$cgi_data{'description'}\n" . - ">How-To-Repeat:\n$cgi_data{'howtorepeat'}\n" . - ">Fix:\n$cgi_data{'fix'}\n"; +$head = "To: " . $gnemail . "\n" . + "From: " . $query->param('email') . "\n" . + "Subject: " . $query->param('synopsis') . "\n" . + "X-Send-Pr-Version: www-1.0\n\n"; + +$body = ">Submitter-Id:\t" . $query->param('submitterid') . "\n" . + ">Originator:\t" . $query->param('originator'). "\n" . + ">Organization:\t" . $query->param('organization') . "\n" . + ">Confidential:\t" . $query->param('confidential') . "\n" . + ">Synopsis:\t" . $query->param('synopsis'). "\n" . + ">Severity:\t" . $query->param('severity'). "\n" . + ">Priority:\t" . $query->param('priority'). "\n" . + ">Category:\t" . $query->param('category'). "\n" . + ">Class:\t\t" . $query->param('class'). "\n" . + ">Release:\t" . $query->param('release'). "\n" . + ">Environment:\t" . $query->param('environment') . "\n" . + ">Description:\n" . $query->param('description') . "\n" . + ">How-To-Repeat:\n" . $query->param('howtorepeat') . "\n" . + ">Fix:\n" . $query->param('fix') . "\n"; + +$pr = $head . $body; # remove any carrage returns that appear in the report. $pr =~ s/\r//g; + +if ($query->param('attachment1') || $query->param('attachment2')) { +# we need to construct a MIME message + $top = MIME::Entity->build( Type => "multipart/mixed", + -From => $query->param('email'), + -To => $gnemail, + -Subject => $query->param('synopsis')); + + $top->attach(Data=>$body); + + { + undef $/; + $fh = $query->param('attachment1'); + $data1 = <$fh>; + } + + # attachment #1 + if (length $data1 > 0) { + $top->attach(Data =>$data1, + Encoding => 'text/plain'); + }; + + { + undef $/; + $fh = $query->param('attachment2'); + $data2 = <$fh>; + } + + # attachment #2 + if (length $data2 > 0) { + $top->attach(Data => $data2, + Encoding => 'text/plain'); + }; + + $io = IO::String->new($pr); + $top->print($io); +} #print "<PRE>$submitprog\n\n$pr\n</PRE>"; if (open (SUBMIT, "|$submitprog")){ ------------=_990861646-1068-0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: text/plain --- send-pr.html.orig Fri May 25 23:25:50 2001 +++ send-pr.html Thu May 24 09:41:27 2001 @@ -28,7 +28,8 @@ you fill in the "Environment" field as requested with the output from the machine on which problem occurred.</P> - <FORM ACTION="http://www.FreeBSD.org/cgi/dosendpr.cgi" METHOD="POST"> <INPUT TYPE="HIDDEN" NAME="gndb" VALUE="freebsd"> + <FORM ACTION="http://sharmas.dhs.org:81/cgi-bin/dosendpr.cgi" METHOD="POST" ENCTYPE="multipart/form-data"> + <INPUT TYPE="HIDDEN" NAME="gndb" VALUE="freebsd"> <INPUT TYPE="HIDDEN" NAME="submitterid" VALUE="net"> <INPUT TYPE="HIDDEN" NAME="confidential" VALUE="no"> @@ -93,12 +94,16 @@ <B>Fix to the problem if known</B>: <BR> <TEXTAREA NAME="fix" ROWS="6" COLS="72"></TEXTAREA><BR> + <B>Attachments</B>: <P> + <INPUT TYPE="FILE" NAME="attachment1"> <BR> + <INPUT TYPE="FILE" NAME="attachment2"> <BR> + <P> + <INPUT TYPE="SUBMIT" VALUE="Submit Problem Report"> <INPUT TYPE="RESET" VALUE="Reset"> + </FORM> - <P><B>Note</B>: copy/paste will destroy TABs and spacing, and this web - form should not be used to submit code as plain text.</P> <HR NOSHADE> <ADDRESS><A HREF="./mailto.html">freebsd-questions@FreeBSD.ORG</A><BR> ------------=_990861646-1068-0-- >Release-Note: >Audit-Trail: >Unformatted: This is a multi-part message in MIME format... ------------=_990861646-1068-0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: binary To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105260720.f4Q7KkV01069>