Subject: | syslog_logopt parser broken |
In Server.pm, the parser for syslog_logopt is broken.
Current:
($opt =~ /^((cons|ndelay|nowait|pid|nofatal)($|[,|]))*/)
Suggested change:
($opt =~ /^(((cons|ndelay|nowait|pid|nofatal),*)*$)/)
I am attaching a test script. Its exec output for a default $opt
= "pid,nofatal", is:
new: nofatal
new2: pid,nofatal
So I think the suggested RE is right.
Subject: | testre.pl |
my $opt = "pid,nofatal";
my $nuevo = ($opt =~ /^((cons|ndelay|nowait|pid|nofatal)($|[,|]))*/)
? $1 : 'pid';
my $nuevo2 = ($opt =~ /^(((cons|ndelay|nowait|pid|nofatal),*)*$)/)
? $1 : 'pid';
print "new: $nuevo\n";
print "new2: $nuevo2\n";