[rt-devel] Bug in the search box

Cormac McGaughey cormac at u.washington.edu
Sat Sep 27 18:02:26 EDT 2003


<?xml  version="1.0" ?><html>
<head>
<title></title>
</head>
<body>
<div align="left"><font face="Arial"><span style="font-size:10pt">Problem: Enter a ticket number in RT 3's search box (top right corner)</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">and hit search. Fastcgi will crash, requiring httpd to be restarted</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">URL shown is: http://xxxxx/rt3/index.html?q=233</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Manully entering this URL will also crash RT3</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Apache log error is:</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">[Sat Sep 27 14:05:24 2003] [error] [client 128.208.247.94] FastCGI: 
comm</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">with server &quot;/rt/rt3/bin/mason_handler.fcgi&quot; aborted: error parsing</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">headers: malformed header 
'Location=&quot;/rt3/Ticket/Display.html?id=233&quot;',</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">referer: http://xxxxx/rt3/User/Prefs.html</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">I fixed this by modifing share/html/index.html as shown below:</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">---Excerpted before change</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">if ( $ARGS{'q'} ) {</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">my $query = $ARGS{'q'};</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">if ( $query =~ m/^\s*(\d+)\s*$/ ) {</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">$m-&gt;redirect(&quot;$RT::WebPath/Ticket/Display.html?id=$1&quot;);</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">}</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">$session{'tickets'} = RT::Tickets-&gt;new( $session{'CurrentUser'} );</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">if ( $query =~ m/\@/ ) {</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">$session{'tickets'}-&gt;LimitRequestor( VALUE =&gt; $query,</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">OPERATOR =&gt; '=', );</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">$m-&gt;redirect(&quot;$RT::WebPath/Search/Listing.html&quot;);</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">}</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">----- End of Excerpt</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">----- New Change</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">if ( $ARGS{'q'} ) {</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">my $query = $ARGS{'q'};</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">#Moved Ticket number query to below $session</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">$session{'tickets'} = RT::Tickets-&gt;new( $session{'CurrentUser'} );</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">if ( $query =~ m/^\s*(\d+)\s*$/ ) {</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">$session{'tickets'}-&gt;LimitRequestor( VALUE =&gt; $query,</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">OPERATOR =&gt; '=', );</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">$m-&gt;redirect(&quot;$RT::WebPath/Ticket/Display.html?id=$1&quot;);</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">}</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">if ( $query =~ m/\@/ ) {</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">$session{'tickets'}-&gt;LimitRequestor( VALUE =&gt; $query,</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">OPERATOR =&gt; '=', );</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">$m-&gt;redirect(&quot;$RT::WebPath/Search/Listing.html&quot;);</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">}</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">---- End of excerpt</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">As you can see I moved the ticket display line after the session setup,</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">and copied a line from the next query. I did that because I wasn't sure</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">what session setup did and was short on time to go explore code. It</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">seems to work so I've left it.</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">I'm reporting this bug to best practical as the same problem was in 
3.0.6RC1</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">My configuration is Red Hat 9, Apache httpd-2.0.40-21.5, mysql 
3.23.56-1.9, fastcgi 2.4.0, perl 5.8.0-88.3</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Cormac</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">--</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Cormac McGaughey</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Computer Support Specialist</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Institute of Technology</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Pinkerton 205B</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">University of Washington Tacoma</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">1900 Commerce St. Box 358426</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Phone: 253-692-4648</span></font></div>
</body>
</html>



More information about the Rt-devel mailing list