Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 573230 Details for
Bug 754854
Using results.xml.gz format to open a new cert results in system error some times
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
all in one patch
patch.diff (text/plain), 7.19 KB, created by
Wei Shen
on 2012-03-28 05:13:14 UTC
(
hide
)
Description:
all in one patch
Filename:
MIME Type:
Creator:
Wei Shen
Created:
2012-03-28 05:13:14 UTC
Size:
7.19 KB
patch
obsolete
>Index: post.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/post.cgi,v >--- post.cgi 1 Feb 2012 05:37:57 -0000 1.112 >+++ post.cgi 19 Mar 2012 10:20:14 -0000 >@@ -42,6 +42,7 @@ > require "hwcert.pl"; > require "globals.pl"; > >+my $maxday = Param("maxday"); > # Hardware Certification Directory Paths > my $homedir = Param("homedir"); # "/var/www/bugzilla/hwcert-rlandry"; > my $rpmsdir = Param("rpmdir"); # "/var/www/bugzilla/hwcert/data/rpms"; >@@ -174,6 +175,7 @@ > } > > $data || ThrowUserError("zero_length_file"); >+ trick_taint($data); > $spec_data = $data; > > if ( $cgi->param('attachment_type') eq "results" ) { >@@ -368,8 +370,10 @@ > } > $data || ThrowUserError("zero_length_file"); > } elsif ($cgi->param('md5')) { >- my $tmp = $cgi->param('data'); >- $data = decode_base64($tmp); >+ my $sum = $cgi->param('md5'); >+ $sum = SqlQuote($sum); >+ SendSQL2("SELECT thedata FROM temp_results WHERE md5sum = $sum"); >+ $data = FetchOneColumn2(); > } > ($testsref, $kernelver) = GetGzResultInfo($data); > } >@@ -469,19 +473,9 @@ > $vars->{'filename'} = $filename; > $vars->{'tmpfilename'} = $tmpfilename; > if ( $filename =~ /\.gz$/ ) { >- $vars->{'data'} = encode_base64($spec_data); >- my $test = "$tmpdir/$md5sum"; >- if (! -d "$test") { >- trick_taint($test); >- mkdir("$test", 0755) >- || ThrowCodeError("system_error", { syserror => "Can't create directory with $md5sum: $!" }); >- } >- my $gzlocation = "$test/results.xml.gz"; >- trick_taint($gzlocation); >- open (TMP, ">$gzlocation") >- || ThrowCodeError("system_error", { syserror => "Unable to create temp file $tmpdir/$md5sum/results.xml.gz: $!" }); >- print TMP $spec_data; >- close (TMP); >+ $vars->{'data'} = ""; #encode_base64($spec_data); >+ my $sql_query = "INSERT INTO temp_results (md5sum, thedata, create_ts) VALUES (?, ?, ". Bugzilla::DB::Now().")"; >+ SendSQL2($sql_query, $md5sum, $spec_data ); > } > $vars->{'kernelver'} = $kernelver; > $vars->{'platform'} = $platform; >@@ -988,12 +982,12 @@ > > $data = do { local( @ARGV, $/ ) = $rpmlocation ; <> } ; > } elsif ($filename =~ /\.gz$/) { >- $data = $cgi->param('data'); >- my $tmpdir = Param("tmpdir"); >- #delete the temp gz file that is for preview purpose >- my $tmpfile = "$tmpdir/$md5sum/results.xml.gz"; >- trick_taint($tmpfile); >- UnlinkPath($tmpfile); >+ my $sum = $cgi->param('md5'); >+ $sum = SqlQuote($sum); >+ SendSQL2("SELECT thedata FROM temp_results WHERE md5sum = ". $sum); >+ my $tmpdata = FetchOneColumn2(); >+ SendSQL2("DELETE FROM temp_results WHERE md5sum = ". $sum); >+ $data = encode_base64($tmpdata); > } > $sqlfilename = $filename; > } else { >@@ -1296,6 +1290,8 @@ > }; > > $vars->{'vendors'} = Hwcert::Vendor::get_vendor_name($public_vendor_only); >+SendSQL2("DELETE FROM temp_results WHERE " . Bugzilla::DB::ToDays('NOW()') . " - " . >+ Bugzilla::DB::ToDays('create_ts') . " >= " . $maxday); > > $template->process("bug/create/created.html.tmpl", $vars) > || ThrowTemplateError($template->error()); > >Index: results.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/results.cgi,v >--- results.cgi 6 Dec 2011 02:06:17 -0000 1.11 >+++ results.cgi 8 Mar 2012 04:52:32 -0000 >@@ -149,17 +149,8 @@ > $results = join("", @rundata); > } > else { >- my $tmpdir = Param("tmpdir"); >- my $gzfile = "$tmpdir/$md5/results.xml.gz"; >- >- my $gzip_data; >- my $fh; >- open ($fh, "<$gzfile")|| ThrowCodeError("system_error"); >- { >- # enable 'slurp' mode >- local $/; >- $gzip_data = <$fh>; >- } >+ SendSQL2("SELECT thedata FROM temp_results WHERE md5sum = ". SqlQuote($md5)); >+ my $gzip_data = FetchOneColumn2(); > my $xslt = XML::LibXSLT->new(); > my $xml = XML::LibXML->new(); > my $raw_xml; >Index: hardware.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/hardware.cgi,v >--- hardware.cgi 6 Dec 2011 02:06:17 -0000 1.16 >+++ hardware.cgi 8 Mar 2012 04:52:32 -0000 >@@ -157,17 +157,8 @@ > $hardware = join("", @hwdata); > } > else { >- my $tmpdir = Param("tmpdir"); >- my $gzfile = "$tmpdir/$md5/results.xml.gz"; >- >- my $gzip_data; >- my $fh; >- open ($fh, "<$gzfile")|| ThrowCodeError("system_error"); >- { >- # enable 'slurp' mode >- local $/; >- $gzip_data = <$fh>; >- } >+ SendSQL2("SELECT thedata FROM temp_results WHERE md5sum = ". SqlQuote($md5)); >+ my $gzip_data = FetchOneColumn2(); > my $xslt = XML::LibXSLT->new(); > my $xml = XML::LibXML->new(); > my $raw_xml; >Index: test.wav.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/test.wav.cgi,v >--- test.wav.cgi 6 Dec 2011 02:06:17 -0000 1.9 >+++ test.wav.cgi 8 Mar 2012 04:52:32 -0000 >@@ -156,17 +156,8 @@ > $results = join("", @soundfile); > } > else { >- my $tmpdir = Param("tmpdir"); >- my $gzfile = "$tmpdir/$md5/results.xml.gz"; >- >- my $gzip_data; >- my $fh; >- open ($fh, "<$gzfile")|| ThrowCodeError("system_error"); >- { >- # enable 'slurp' mode >- local $/; >- $gzip_data = <$fh>; >- } >+ SendSQL2("SELECT thedata FROM temp_results WHERE md5sum = ". SqlQuote($md5)); >+ my $gzip_data = FetchOneColumn2(); > my $xslt = XML::LibXSLT->new(); > my $xml = XML::LibXML->new(); > my $raw_xml; >Index: sysreport.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/sysreport.cgi,v >--- sysreport.cgi 14 Dec 2011 02:46:56 -0000 1.11 >+++ sysreport.cgi 8 Mar 2012 04:52:32 -0000 >@@ -165,17 +165,8 @@ > $filename = basename($location); > } > else { >- my $tmpdir = Param("tmpdir"); >- my $gzfile = "$tmpdir/$md5/results.xml.gz"; >- >- my $gzip_data; >- my $fh; >- open ($fh, "<$gzfile")|| ThrowCodeError("system_error"); >- { >- # enable 'slurp' mode >- local $/; >- $gzip_data = <$fh>; >- } >+ SendSQL2("SELECT thedata FROM temp_results WHERE md5sum = ". SqlQuote($md5)); >+ my $gzip_data = FetchOneColumn2(); > my $xslt = XML::LibXSLT->new(); > my $xml = XML::LibXML->new(); > my $raw_xml; >Index: defparams.pl >=================================================================== >RCS file: /cvs/qa/hwcert/defparams.pl,v >retrieving revision 1.26.2.2 >diff -u -r1.26.2.2 defparams.pl >--- defparams.pl 21 Mar 2012 07:40:22 -0000 1.26.2.2 >+++ defparams.pl 28 Mar 2012 05:08:01 -0000 >@@ -1451,6 +1451,12 @@ > type => 'b', > default => 1, > }, >+{ >+ name => 'maxday', >+ desc => 'the max day temp results live', >+ type => 't', >+ default => '2', >+}, > ); > 1; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 754854
: 573230