[Pkg-clamav-devel] Bug#922617: clamav-freshclam: tries to set SE Linux context before creating dir and fails

Russell Coker russell at coker.com.au
Mon Feb 18 13:25:21 GMT 2019


Package: clamav-freshclam
Version: 0.100.2+dfsg-2
Severity: normal
Tags: patch


The init script tries to set the context of the directory (think chown or
chmod) before creating it.  Here is the patch to fix it.

--- /etc/init.d/clamav-freshclam.orig	2019-02-19 00:18:42.180626975 +1100
+++ /etc/init.d/clamav-freshclam	2019-02-19 00:19:35.828821960 +1100
@@ -187,13 +187,13 @@
 make_dir()
 {
   DIR=$1
-  [ -x /sbin/restorecon ] && /sbin/restorecon "$DIR"
   if [ -d "$DIR" ]; then
     return 0;
   fi
   [ -n "$User" ] || User=clamav
   mkdir -p -m 0755 "$DIR"
   chown "$User" "$DIR"
+  [ -x /sbin/restorecon ] && /sbin/restorecon "$DIR"
 }
 
 # Debconf Functions



More information about the Pkg-clamav-devel mailing list