Skip to content

Commit 49f7b5a

Browse files
committed
[Fix] ignore_inotify.defaults: restore ClamAV scantemp coverage; issue #484
[Fix] Add literal "scantemp." substring (trailing dot prevents user-file FP like scantemplate.php) — restores the noise suppression dropped in commit 984c0b1 (issue #480 sentinel fixup) [Change] tests/47-ignore-inotify-defaults.bats: +2 sentinel tests [Change] CHANGELOG, CHANGELOG.RELEASE: v2.0.1 [Fix] entry
1 parent 6bfd474 commit 49f7b5a

4 files changed

Lines changed: 31 additions & 1 deletion

File tree

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ v2.0.1 | Mar 25 2026:
240240
[Fix] monitor: ignore_paths now uses grep -E -vf (ERE) to match scan-mode
241241
semantics; fixes silent regression from awk index() substring
242242
filter introduced by monitor-mode redesign; issue #484
243+
[Fix] ignore_inotify.defaults: re-add "scantemp." (trailing-dot-safe) for
244+
ClamAV scan-temp directory noise; trailing dot prevents matching
245+
user files named scantemplate.*; issue #484, #104, #431
243246

244247
[Fix] monitor: ownership filters (scan_ignore_root/user/group) unconditionally
245248
excluded root-owned files in monitor mode; root-owned malware drops silently

CHANGELOG.RELEASE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ v2.0.1 | Mar 25 2026:
240240
[Fix] monitor: ignore_paths now uses grep -E -vf (ERE) to match scan-mode
241241
semantics; fixes silent regression from awk index() substring
242242
filter introduced by monitor-mode redesign; issue #484
243+
[Fix] ignore_inotify.defaults: re-add "scantemp." (trailing-dot-safe) for
244+
ClamAV scan-temp directory noise; trailing dot prevents matching
245+
user files named scantemplate.*; issue #484, #104, #431
243246

244247
[Fix] monitor: ownership filters (scan_ignore_root/user/group) unconditionally
245248
excluded root-owned files in monitor mode; root-owned malware drops silently

files/internals/ignore_inotify.defaults

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ memcached.sock
4141
# ClamAV runtime temp
4242
/var/tmp/clamav-
4343
/tmp/clamav-
44+
scantemp.
4445

4546
# LMD install paths (legacy + FHS) — covers scan temp workspaces transitively
4647
/usr/local/maldetect/

tests/47-ignore-inotify-defaults.bats

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ _source_lmd_stack() {
5959
# bats test_tags=monitor,defaults
6060
@test "defaults: user ignore_inotify contains no regex anchors or metacharacter defaults" {
6161
run bash -c "grep -E '^[^#[:space:]].*(\\^|\\\$|\\.\\*|\\\\\\.)' '$LMD_INSTALL/ignore_inotify'"
62-
# expect: grep returns 1 (no match) — no regex patterns survived P2
62+
# expect: no live regex anchors or wildcards in shipped user ignore_inotify
63+
# template (issue #484 restored ERE semantics but the shipped template still
64+
# has only comment scaffolding — this test guards against accidental re-
65+
# introduction of live regex defaults).
6366
[ "$status" -eq 1 ]
6467
}
6568

@@ -207,3 +210,23 @@ _source_lmd_stack() {
207210
done < "$LMD_INSTALL/internals/ignore_inotify.defaults"
208211
[ "$hit" -ge 1 ]
209212
}
213+
214+
# bats test_tags=monitor,defaults
215+
@test "defaults: scantemp. entry is installed in ignore_inotify.defaults" {
216+
# Integration: verify the entry is actually shipped in the installed file.
217+
# issue #484 — pure string-match tests duplicate bash syntax coverage;
218+
# this one exercises the real installation path.
219+
run bash -c "grep -cxF 'scantemp.' '$LMD_INSTALL/internals/ignore_inotify.defaults'"
220+
[ "$status" -eq 0 ]
221+
[ "$output" = "1" ]
222+
}
223+
224+
# bats test_tags=monitor,defaults
225+
@test "defaults: scantemp. is emitted with d: prefix by union helper" {
226+
# Integration: the defaults entry reaches the exclude-regex pipeline.
227+
_source_lmd_stack
228+
run _monitor_load_ignore_inotify_union "$LMD_INSTALL/ignore_inotify" \
229+
"$LMD_INSTALL/internals/ignore_inotify.defaults"
230+
[ "$status" -eq 0 ]
231+
echo "$output" | grep -qxF 'd:scantemp.'
232+
}

0 commit comments

Comments
 (0)