Thanks for the patch - I will incorporate a similar fix into the next
Webmin release.
- Jamie
On Sun, 2004-02-01 at 04:32, Eldy wrote:
> This mail is to report a bug in the new logrotate tool and provide the
> patch.
> When there is several log in the first line of a logrotate file (and
> this is possible according to logrotate doc), Webmin ignores the whole file.
>
> This is the patch to solve this.
>
> --- logrotate-lib.pl.old Sat Jan 31 18:24:12 2004
> +++ logrotate-lib.pl Sat Jan 31 18:22:47 2004
> @@ -38,16 +38,20 @@
> while(<$fh>) {
> s/\r|\n//g;
> s/#.*$//;
> - if (/^\s*(\S+)\s*{\s*$/) {
> - # Start of a section
> - $section = { 'name' => $1,
> + if (/^\s*(.*)\s*{\s*$/) {
> + foreach my $logfile (split(/\s+/,$1)) {
> + if ($logfile) {
> + # Start of a section
> + $section = { 'name' => $logfile,
> 'members' => [ ],
> 'index' => scalar(@$addto),
> 'line' => $lnum,
> 'eline' => $lnum,
> 'file' => $file };
> - push(@$addto, $section);
> - $addto = $section->{'members'};
> + push(@$addto, $section);
> + $addto = $section->{'members'};
> + }
> + }
> }
> elsif (/^\s*}\s*$/) {
> # End of a section
>
>
|