File: chkrootkit-chk_w.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 (40 lines) | stat: -rw-r--r-- 1,006 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
From: Richard Lewis <richard.lewis.debian@googlemail.com>
Date: Thu, 17 Oct 2024 22:25:42 +0100
Subject: chkrootkit: chk_w

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

diff --git a/chkrootkit b/chkrootkit
index 8adb195..5048214 100755
--- a/chkrootkit
+++ b/chkrootkit
@@ -2277,7 +2277,10 @@ chk_write () {
 
 chk_w () {
     STATUS=${NOT_INFECTED}
-    CMD=`loc w w $pth`
+    CMD=$(loc w w "$pth")
+    if [ "${?}" -ne 0 ]; then
+        return "${NOT_FOUND}"
+    fi
     W_INFECTED_LABEL="uname -a"
 
     if [ "${EXPERT}" = "t" ]; then
@@ -2285,11 +2288,11 @@ chk_w () {
         expertmode_output "${ls} -l ${CMD}"
         return 5
     fi
-    if ${strings} -a ${CMD} | ${egrep} "${W_INFECTED_LABEL}" > /dev/null 2>&1
+    if "${strings}" -a "${CMD}" | ${egrep} "${W_INFECTED_LABEL}" > /dev/null 2>&1
     then
         STATUS=${INFECTED}
     fi
-    return ${STATUS}
+    return "${STATUS}"
 }
 
 chk_vdir () {