summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/prtverify/20_evil_cmds.awk8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/prtverify/20_evil_cmds.awk b/lib/prtverify/20_evil_cmds.awk
index 9c0ff9a..88114a3 100644
--- a/lib/prtverify/20_evil_cmds.awk
+++ b/lib/prtverify/20_evil_cmds.awk
@@ -1,7 +1,7 @@
#
# 20_evil_cmds.awk
#
-# Version 0.1.2 - 2006-07-14
+# Version 0.1.3 - 2008-05-21
# Jürgen Daubert <jue at jue dot li>
#
# Two test to find malicious rm and cd commands like 'rm -rf /usr'.
@@ -18,10 +18,10 @@
loglevel_ok(FATAL) && FILENAME ~ PKGFILE {
- if (match($0, /\<rm\>/)) {
+ if (match($0, /(^|[[:blank:]])+rm[[:blank:]]+/)) {
a = substr($0, RSTART)
-
+
while ($0 ~ /\\$/) {
getline
a = a $0
@@ -37,7 +37,7 @@ loglevel_ok(FATAL) && FILENAME ~ PKGFILE {
}
- if ($0 ~ /\<cd\>/) {
+ if ($0 ~ /(^|[[:blank:]])+cd[[:blank:]]+/) {
for (c=1; c<=NF; c++) {
if ($c == "cd" && $(c+1) ~ /^\//)
perror(FATAL, "Use of cd to go outside the workdir, Pkgfile line " NR)

Generated by cgit