[Mimedefang] Clamd patch for errors; file permissions

Nate Carlson natecars at real-time.com
Mon Mar 8 17:08:15 EST 2004


Hey all,

According to the changelog for 2.40:

        * Loosened spool directory permissions -- made them group-readable
        so you can run ClamAV as its own user (as long as it's in the defang
        group.)

I've installed 2.40, but I'm still seeing the following permissions in the
directories created under /var/spool/MIMEDefang:

drwx------    3 defang   defang       1.0k Mar  8 08:07 mdefang-i28E7u5D008574

and the Work subdirectory under that:

drwx------    2 defang   defang       1.0k Mar  8 08:07 .
drwx------    3 defang   defang       1.0k Mar  8 08:07 ..
-rw-r-----    2 defang   defang       1.2k Mar  8 08:07 INPUTMSG
-rw-------    1 defang   defang          5 Mar  8 08:07 msg-8530-3.txt
-rw-------    1 defang   defang         70 Mar  8 08:07 msg-8530-4.virus

..the perms certainly aren't group-accessible on my box; did I miss 
something in the configuration?

Also, the current method of calling clamd does not fail if clamd runs into 
an error reading the file off the filesystem. I've included a patch to fix 
that issue. Note that I haven't heavily tested this, so it's possible it 
breaks other things, but it is fairly simple.

Thanks for all the hard work!

-- 
Nate Carlson <natecars at real-time.com>   | Phone : (952)943-8700
http://www.real-time.com                | Fax   : (952)943-8500
-------------- next part --------------
diff -Naur mimedefang-2.40/mimedefang.pl.in mimedefang-2.40-clamaverror/mimedefang.pl.in
--- mimedefang-2.40/mimedefang.pl.in	Fri Mar  5 09:35:35 2004
+++ mimedefang-2.40-clamaverror/mimedefang.pl.in	Mon Mar  8 15:55:01 2004
@@ -3973,6 +3973,9 @@
 	    $VirusName = $1;
 	    return (wantarray ? (1, 'virus', 'quarantine') : 1);
 	}
+	elsif ($output =~ /: (.+) ERROR/) {
+	    return (wantarray ? (999, 'swerr', 'tempfail') : 1);
+	}
 	return (wantarray ? (0, 'ok', 'ok') : 0);
     }
     # Could not connect to daemon


More information about the MIMEDefang mailing list