diff options
| author | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2024-01-10 11:48:56 +0000 |
|---|---|---|
| committer | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2024-01-24 12:04:50 +0000 |
| commit | dd5dabe284831a40bb8ef4749b352c03bf9f4a44 (patch) | |
| tree | 56753d495442dc34709b470da94c0778f3e0ca1c | |
| parent | 7c44565e23a8315cc8be0218b4f7d632411cf688 (diff) | |
| download | src-dd5dabe284831a40bb8ef4749b352c03bf9f4a44.tar.gz src-dd5dabe284831a40bb8ef4749b352c03bf9f4a44.zip | |
periodic: Fix periodic reports when log files are not compressed.
The modern zcat(1) is capable of handling compressed and uncompressed
text files, so we can simply use zcat command.
PR: 253168
Reviewed by: delphij
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43357
(cherry picked from commit 1fa4ddcc6de6a0c46416f719a5b7efa1169f51ce)
| -rwxr-xr-x | usr.sbin/periodic/etc/security/800.loginfail | 7 | ||||
| -rwxr-xr-x | usr.sbin/periodic/etc/security/900.tcpwrap | 7 |
2 files changed, 2 insertions, 12 deletions
diff --git a/usr.sbin/periodic/etc/security/800.loginfail b/usr.sbin/periodic/etc/security/800.loginfail index 4329728f9505..c5a3a972aaa1 100755 --- a/usr.sbin/periodic/etc/security/800.loginfail +++ b/usr.sbin/periodic/etc/security/800.loginfail @@ -49,12 +49,7 @@ catmsgs() { sort -t. -r -n -k 2,2 | while read f do - case $f in - *.gz) zcat -f $f;; - *.bz2) bzcat -f $f;; - *.xz) xzcat -f $f;; - *.zst) zstdcat -f $f;; - esac + zcat -f $f done [ -f ${LOG}/auth.log ] && cat $LOG/auth.log } diff --git a/usr.sbin/periodic/etc/security/900.tcpwrap b/usr.sbin/periodic/etc/security/900.tcpwrap index ae081ded6a95..55fa58f4df39 100755 --- a/usr.sbin/periodic/etc/security/900.tcpwrap +++ b/usr.sbin/periodic/etc/security/900.tcpwrap @@ -49,12 +49,7 @@ catmsgs() { sort -t. -r -n -k 2,2 | while read f do - case $f in - *.gz) zcat -f $f;; - *.bz2) bzcat -f $f;; - *.xz) xzcat -f $f;; - *.zst) zstdcat -f $f;; - esac + zcat -f $f done [ -f ${LOG}/messages ] && cat $LOG/messages } |
