Skip to content

Commit 805f03f

Browse files
committed
audit_rules_watch fail tests sed update
1 parent 65b278f commit 805f03f

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

tests/shared/audit_rules_watch/auditctl_wrong_rule.fail.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# packages = audit
33

44
if [[ "$style" == "modern" ]] ; then
5-
sed -i "/$filter_type=$(echo "$path" | sed 's/\//\\\//g')/d" /etc/audit/audit.rules
5+
escaped_path=$(echo "$path" | sed 's/\//\\\//g')
6+
sed -i "/$filter_type=$escaped_path/d" /etc/audit/audit.rules
67
echo "-a always,exit -F arch=b32 -F $filter_type=$path -F perm=w -F key=logins" >> /etc/audit/audit.rules
78
echo "-a always,exit -F arch=b64 -F $filter_type=$path -F perm=w -F key=logins" >> /etc/audit/audit.rules
89
else

tests/shared/audit_rules_watch/auditctl_wrong_rule_without_key.fail.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# packages = audit
33

44
if [[ "$style" == "modern" ]] ; then
5-
sed -i "/$filter_type=$(echo "$path" | sed 's/\//\\\//g')/d" /etc/audit/audit.rules
5+
escaped_path=$(echo "$path" | sed 's/\//\\\//g')
6+
sed -i "/$filter_type=$escaped_path/d" /etc/audit/audit.rules
67
echo "-a always,exit -F arch=b32 -F $filter_type=$path -F perm=w" >> /etc/audit/audit.rules
78
echo "-a always,exit -F arch=b64 -F $filter_type=$path -F perm=w" >> /etc/audit/audit.rules
89
else

tests/shared/audit_rules_watch/augenrules_wrong_rule_without_key.fail.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44

55
if [[ "$style" == "modern" ]] ; then
6-
sed -i "/$filter_type=$(echo "$path" | sed 's/\//\\\//g')/d" /etc/audit/rules.d/*.rules 2>/dev/null || true
6+
escaped_path=$(echo "$path" | sed 's/\//\\\//g')
7+
sed -i "/$filter_type=$escaped_path/d" /etc/audit/rules.d/*.rules 2>/dev/null || true
78
echo "-a always,exit -F arch=b32 -F $filter_type=$path -F perm=w" >> /etc/audit/rules.d/login.rules
89
echo "-a always,exit -F arch=b64 -F $filter_type=$path -F perm=w" >> /etc/audit/rules.d/login.rules
910
else

0 commit comments

Comments
 (0)