mainGnatsweb - Support: sr #103527, Stored queries fail when fields...

 
 

sr #103527: Stored queries fail when fields contain a dash

Submitter:  Stuart Stevens <stevensgb>
Submitted:  Mon 01 Nov 2004 09:17:25 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  4 - Important Status:  Done
Privacy:  Public Assigned to:  yngves
Open/Closed:  Closed Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 14 Sep 2006 09:13:41 AM UTC, comment #1: 

Sorry for the looooong response time. Gnatsweb development was picked up again only very recently, and variation of the patch you submitted was committed recently. If you try the latest version from CVS, the problem should be gone. Thanks for taking the time to report this!

Yngve Svendsen <yngves>
Group Member
Mon 01 Nov 2004 09:17:25 PM UTC, original submission:  

Stored queries are stripped of fields with no values.  The pattern used is "/\w+=;/" which does not include dashes.  Fields that are split improperly cause the parser to make an incorrect query when the wuery is reexecuted.

    Date: Friday, October 29, 2004 @ 10:20:00
  Author: stuart
    Path: /cvsroot/firmware/gnats/gnatsweb

Modified: gnatsweb.pl (1.1.1.1 -> 1.2)

GNAT 50087 Field names with dashes are removed intact


-------------+
 gnatsweb.pl |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


Index: firmware/gnats/gnatsweb/gnatsweb.pl
diff -u firmware/gnats/gnatsweb/gnatsweb.pl:1.1.1.1 firmware/gnats/gnatsweb/gnatsweb.pl:1.2
--- firmware/gnats/gnatsweb/gnatsweb.pl:1.1.1.1 Thu Oct 28 14:41:11 2004
+++ firmware/gnats/gnatsweb/gnatsweb.pl Fri Oct 29 10:20:00 2004
@@ -20,7 +20,7 @@
 # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 #
-# $Id: gnatsweb.pl,v 1.1.1.1 2004/10/28 21:41:11 stuart Exp $
+# $Id: gnatsweb.pl,v 1.2 2004/10/29 17:20:00 stuart Exp $
 #
 
 use strict;
@@ -241,7 +241,7 @@
 
 # Version number + RCS revision number
 $VERSION = '4.00';
-my $REVISION = (split(/ /, '$Revision: 1.1.1.1 $ '))[1];
+my $REVISION = (split(/ /, '$Revision: 1.2 $ '))[1];
 my $GNATS_VERS = '0.0';
 
 # bits in fieldinfo(field, flags) has (set=yes not-set=no)
@@ -2585,8 +2585,10 @@
 
   # strip empty params out of $query_string.  in a gnats db with many
   # fields, the query-string will become very long, and may exceed the
-  # 4K limit for cookies.
-  $query_string =~ s/\w+=;//g;
+  # 4K limit for cookies.  The pattern must match escaped field names
+  # and include dashes.  A field name cannot contain ":" or ">".  If
+  # it contains a ";" or a left or right arrow then the HTML will fail.
+  $query_string =~ s/[^ =;:>]+=;//g;
 
   if (length($query_string . $global_cookie_path . "gnatsweb-query-$queryname") > 4050) {
     # this cookie is going to be longer than 4K, so we'll have to punt

Stuart Stevens <stevensgb>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-09-14 yngves StatusNone Done
    Assigned toNone yngves
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code