Subject: bin/16291: newsyslog always compresses archived log files
To: None <gnats-bugs@gnats.netbsd.org>
From: Markus W Kilbinger <kilbi@rad.rwth-aachen.de>
List: netbsd-bugs
Date: 04/10/2002 19:50:50
>Number: 16291
>Category: bin
>Synopsis: newsyslog always compresses archived log files
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Apr 10 10:51:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Markus W Kilbinger
>Release: NetBSD 1.5.3 and -current
>Organization:
>Environment:
System: NetBSD zentrum 1.5.3 NetBSD 1.5.3 (ZENTRUM) #0: Sat Apr 6 01:51:01 MEST 2002 root@lkegw:/amd/lwle5.radiologie/usr/src-1.5/sys/arch/i386/compile/ZENTRUM i386
Architecture: all
Machine: all
>Description:
newsyslog always compresses archived log files (e .g to
*.0.gz) though it is deactivated in newsyslog.conf (flag 'z'
not set).
>How-To-Repeat:
Create a 'z'-flag-less entry in /etc/newsyslog.conf and
observe the results after running newsyslog.
>Fix:
As far as I can see compressing the archived log files is done
in any case and does not depend on setting the 'z'-flag. ->
Make it depend an setting the 'z'-flag, like:
diff -u -b -r1.21.4.2 newsyslog.c
--- newsyslog.c 2002/03/06 23:34:45 1.21.4.2
+++ newsyslog.c 2002/04/10 17:47:21
@@ -542,6 +542,7 @@
* if 'p' has been specified.) It should be noted that gzip(1)
* preserves file ownership and file mode.
*/
+ if (log->flags & CE_COMPRESS) {
for (i = (log->flags & CE_PLAIN0) != 0; i < log->numhist; i++) {
snprintf(file1, sizeof (file1), "%s.%d", log->logfile, i);
if (lstat(file1, &st) != 0)
@@ -550,6 +551,7 @@
if (lstat(file2, &st) == 0)
continue;
log_compress(log, file1);
+ }
}
log_trimmed(log);
>Release-Note:
>Audit-Trail:
>Unformatted: