File: chkrootkit-chk_sshd.patch

package info (click to toggle)
chkrootkit 0.58b-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 7,796 kB
  • sloc: sh: 187,095; ansic: 3,779; makefile: 103
file content (47 lines) | stat: -rw-r--r-- 1,290 bytes parent folder | download | duplicates (2)
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
From: Richard Lewis <richard.lewis.debian@googlemail.com>
Date: Sat, 16 Oct 2021 12:27:48 +0100
Subject: chkrootkit: chk_sshd

Fix logic so that sshd test runs: '-s' means size >0, so we want
NOTFOUND if -s fails

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

diff --git a/chkrootkit b/chkrootkit
index a6bc118..64473ca 100755
--- a/chkrootkit
+++ b/chkrootkit
@@ -2663,8 +2663,8 @@ chk_sshd () {
     SSHD2_INFECTED_LABEL="check_global_passwd|panasonic|satori|vejeta|\.ark|/hash\.zk"
     getCMD 'sshd'
 
-    if [ -s ${CMD} ]; then
-       return ${NOT_FOUND}
+    if [ ! -s "${CMD}" ]; then
+       return "${NOT_FOUND}"
     fi
 
     if [ "${EXPERT}" = "t" ]; then
@@ -2672,15 +2672,15 @@ chk_sshd () {
         return 5
     fi
 
-    if ${strings} -a "${CMD}" | ${egrep} "${SSHD2_INFECTED_LABEL}" \
+    if "${strings}" -a "${CMD}" | ${egrep} "${SSHD2_INFECTED_LABEL}" \
        > /dev/null 2>&1
     then
         STATUS=${INFECTED}
-        if ${ps} ${ps_cmd} | ${egrep} sshd >/dev/null 2>&1; then
+        if "${ps}" "${ps_cmd}" | ${egrep} sshd >/dev/null 2>&1; then
            STATUS=${INFECTED_BUT_DISABLED}
         fi
     fi
-    return ${STATUS}
+    return "${STATUS}"
 }
 
 chk_su () {