[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 51/60] history reporting (nfc): Quote keys too


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:56 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Aug 2020 17:26:46 +0000
  • Ironport-sdr: XoG6gYs8oHYMIMiQUF2RL0BFjmGVARyQUFF3LUF53oE12LXrKBkrB29+qKkWDNMPeqYRUAzB+X 26lzMu667c4cNPHXWm6uftejAtZIK34FcWb4b28MKb/U5cFQNAqGGdXFzKJZrBLzrdCf3Gg92K KpXDVqQ9YO8hQALwzDfx7VGO55Q4b5izAiBhkbeJHJirXGNPCKKzVFwuFTVwhXqt9ZrlBVwYUL 5cWb+TzEHshmQMHzS6P2j7sARBw7ByMJDN92bL4vnBw6AxFVODndz4nBcERyPZkgR1kAUE2Z0v MIA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Right now all the callers have keys which don't need quoting.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/HistoryReport.pm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Osstest/HistoryReport.pm b/Osstest/HistoryReport.pm
index 20913d27..3e2ad0d3 100644
--- a/Osstest/HistoryReport.pm
+++ b/Osstest/HistoryReport.pm
@@ -147,8 +147,9 @@ sub cache_read_previous ($) {
                $jr->{'%'.$&} = $ch;
                next;
            }
-           s{^(\w+)=}{} or die "$orig -- $_ ";
-           my $k = $1;
+           # Tolerate %, which will be de-quoted by url_unquote
+           s{^([\%$url_ok_chars]+)=}{}i or die "$orig -- $_ ";
+           my $k = url_unquote($1);
            $ch->{$k} = url_unquote($_);
        }
        push @previous, $jr;
@@ -192,7 +193,7 @@ sub cache_write_entry ($$) {
            next if $k =~ m/^\%/;
            $_ = $h->{$k};
            next unless defined;
-           printf $fh " %s=%s", $k, url_quote($_);
+           printf $fh " %s=%s", url_quote($k), url_quote($_);
        }
     };
     $whash->($jr);
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.