From 4b2b4052bd3a73d6ff39803a9977c3a7bff71a9c Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Fri, 26 Feb 2021 21:18:31 -0600 Subject: [PATCH] Handle missing HOSTNAME field in mock syslog server --- testsuite/lib/exec/minlogd.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/lib/exec/minlogd.pl b/testsuite/lib/exec/minlogd.pl index 5d7f662..610cb6c 100755 --- a/testsuite/lib/exec/minlogd.pl +++ b/testsuite/lib/exec/minlogd.pl @@ -148,7 +148,7 @@ sub handle_message ($) { { $TIMESTAMP = strftime '%Y-%m-%dT%H:%M:%S', localtime } - if (m/\G(\S+) /gc) { $HOSTNAME = $1 } + if (m/\G([-[:alnum:]]+) /gc) { $HOSTNAME = $1 } else { $HOSTNAME = 'localhost' } $MSG = substr $_, pos $_ if pos $_; -- 2.25.1