$whoami = $ident;
- if (!$ident && $mask =~ /^(\S.*):\s?(.*)/) {
+ if (!$whoami && $mask =~ /^(\S.*?):\s?(.*)/) {
$whoami = $1;
$mask = $2;
}
unless ($host) {
require Sys::Hostname;
my($host_uniq) = Sys::Hostname::hostname();
- ($host) = $host_uniq =~ /(\w+)/;
+ ($host) = $host_uniq =~ /([A-Za-z0-9_.-]+)/; # allow FQDN (inc _)
}
my $udp = getprotobyname('udp');
my $syslog = getservbyname('syslog','udp');