From: Jacob Bachmeyer Date: Sat, 27 Feb 2021 03:18:31 +0000 (-0600) Subject: Handle missing HOSTNAME field in mock syslog server X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4b2b4052bd3a73d6ff39803a9977c3a7bff71a9c;p=gatekeeper.git Handle missing HOSTNAME field in mock syslog server --- 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 $_;