File: chkrootkit-helper-functions-for-reporting-results.patch

package info (click to toggle)
chkrootkit 0.58b-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,796 kB
  • sloc: sh: 187,095; ansic: 3,779; makefile: 103
file content (57 lines) | stat: -rw-r--r-- 1,150 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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 () {