git: dd5dabe28483 - stable/14 - periodic: Fix periodic reports when log files are not compressed.

From: Yoshihiro Takahashi <nyan_at_FreeBSD.org>
Date: Wed, 24 Jan 2024 12:05:24 UTC
The branch stable/14 has been updated by nyan:

URL: https://cgit.FreeBSD.org/src/commit/?id=dd5dabe284831a40bb8ef4749b352c03bf9f4a44

commit dd5dabe284831a40bb8ef4749b352c03bf9f4a44
Author:     Yoshihiro Takahashi <nyan@FreeBSD.org>
AuthorDate: 2024-01-10 11:48:56 +0000
Commit:     Yoshihiro Takahashi <nyan@FreeBSD.org>
CommitDate: 2024-01-24 12:04:50 +0000

    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)
---
 usr.sbin/periodic/etc/security/800.loginfail | 7 +------
 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
 }