From: Richard Lewis <richard.lewis.debian@googlemail.com>
Date: Wed, 16 Oct 2024 09:18:23 +0100
Subject: chkrootkit: helper functions for reporting results

Forwarded: yes
(Forwarded by email: 21 Dec 2024)
---
 chkrootkit | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/chkrootkit b/chkrootkit
index 3c41625..12abf77 100755
--- a/chkrootkit
+++ b/chkrootkit
@@ -430,6 +430,42 @@ lkm (){
     [ "$QUIET" != "t" ] && echo "finished"
 }
 
+_start(){
+		if [ "${QUIET}" != "t" ]; then \
+				printn "Searching for ${1}... "
+		fi
+}
+
+_warn(){
+		if [ "${QUIET}" != "t" ]; then
+				# Finish the "checking ..." line
+				echo "WARNING"
+				# blank line before output
+				echo
+		fi
+		# One line only in quiet mode
+		printf "WARNING: %b\n" "$1"
+}
+
+_not_found(){
+		if [ "${QUIET}" != "t" ]; then
+				echo "not found"
+		fi
+}
+
+# $1 is a message ("possible rootkit"), $2 a list of suspect files found (or empty)
+_report(){
+		if [ -n "$2" ]; then
+				_warn "$1:\n$2\n"
+		else
+				_not_found
+		fi
+}
+
+_not_tested(){
+		if [ "${QUIET}" != "t" ]; then
+				echo "not tested"
+		fi
 }
 
 aliens () {
