[Pkg-clamav-devel] Bug#987711: ClamAV freshclam cannot exec scripts defined by OnErrorExecute or OnUpdateExecute

edmund at proteamail.com edmund at proteamail.com
Wed Dec 2 14:56:51 GMT 2026


Confirmed still fully reproducible on clamav-freshclam 1.4.7 (unstable).

With OnErrorExecute pointing at a run-parts invocation in
/etc/clamav/onerrorexecute.d (same setup as the original report), the
current AppArmor profile (debian/usr.bin.freshclam) denies the whole
mechanism:

  apparmor="DENIED" operation="exec" ... name="/usr/bin/dash" ...
  apparmor="DENIED" operation="open" ... name="/etc/clamav/onerrorexecute.d/" ...

I tested the following addition to debian/usr.bin.freshclam, which
resolves it completely (verified via journalctl -k with zero denials,
while the hook actually ran and wrote its output):

  /usr/bin/dash rix,
  /usr/bin/run-parts rix,
  /etc/clamav/onerrorexecute.d/* rix,
  /etc/clamav/onupdateexecute.d/* rix,
  /etc/clamav/onerrorexecute.d/ r,
  /etc/clamav/onupdateexecute.d/ r,

(The existing profile only granted "mr" on the hook-dir file glob,
which allows reading a script's contents but not executing it, and
never granted any exec permission on dash/run-parts, nor read access
on the directory nodes themselves for listing.)

Whatever an individual hook script itself needs beyond this (logger,
mail, curl, etc.) is going to be site-specific, and should be
configured in /etc/apparmor.d/local/usr.bin.freshclam (just as any
other local override). 



More information about the Pkg-clamav-devel mailing list