diff mbox series

[OSSTEST,1/3] known_hosts handling: Fix over-broad SQL query

Message ID 20201016163615.5086-1-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series [OSSTEST,1/3] known_hosts handling: Fix over-broad SQL query | expand

Commit Message

Ian Jackson Oct. 16, 2020, 4:36 p.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index f2d8a0e1..5e6b15d9 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -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