]> xenbits.xensource.com Git - osstest.git/commitdiff
known_hosts handling: Fix over-broad SQL query
authorIan Jackson <iwj@xenproject.org>
Fri, 16 Oct 2020 15:28:48 +0000 (16:28 +0100)
committerIan Jackson <iwj@xenproject.org>
Fri, 16 Oct 2020 16:25:59 +0000 (17:25 +0100)
This should match only "*_host" and "host".  We don't want it matching
"*host" without a "_".

Signed-off-by: Ian Jackson <iwj@xenproject.org>
Osstest/TestSupport.pm

index f2d8a0e1d93f5edd545c59ee8f1df1ab0e648543..5e6b15d9ab4dcc83d3f0a6d2d7b90c6e1a80690c 100644 (file)
@@ -2796,7 +2796,7 @@ sub known_hosts () {
 
     my $hostsq= $dbh_tests->prepare(<<END);
         SELECT val FROM runvars
-         WHERE flight=? AND name LIKE '%host'
+         WHERE flight=? AND (name = 'host' OR name LIKE '%\\_host')
          GROUP BY val
 END
     $hostsq->execute($flight);