--- SweepViruses.pm	Thu Jul  5 21:14:43 2007
+++ SweepViruses.pm.mod	Thu Jul  5 21:52:36 2007
@@ -3293,8 +3293,15 @@
       # Pull the basedir out and change it to a dot for the parser
       $results =~ s/$ScanDir/\./;
       $results =~ s/:\s/\//;
 
+      # If we get an access denied error then print the properly
+      # formatted error and leave
+      print "ERROR::Permissions Problem Clamd was denied access to " .
+            "$ScanDir::$ScanDir\n"
+            if $results =~ /\.\/Access denied\. ERROR/;
+      last if $results =~ /\.\/Access denied\. ERROR/;
+
       # If scanning full batch clamd returns OK on the directory
       # name at the end of the scan so we discard that result when
       # we get to it
       next if $results =~ /^\.\/OK/;
@@ -3310,9 +3317,9 @@
       } elsif ($rest =~ /^.+\sERROR$/) {
         print "ERROR:: $rest :: $dirname/$childname/$filename\n";
         next;
       } else {
-        print "CLEAN:: :: $dirname/$childname/$filename\n";
+          print "ERROR::UNKOWN CLAMD RETURN $results :: $ScanDir\n";
       }
     }
 
     close($sock);
