diff --git a/java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java b/java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java index 759cef5e01fd8bc96253fd016ce82c225991a29d..d64339157b4621236f0935b28e60630643e4688b 100644 --- a/java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java +++ b/java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java @@ -275,41 +275,33 @@ public class SLUBVirusCheckClamAVPlugin implements VirusCheckPluginV2 { * @param fileFullPath scans given file via clamd */ public void scan(String fileFullPath) { + setStatus(Status.UNDETERMINED); /* default */ try { Socket socket = openSocket(); - InputStream in = new FileInputStream(fileFullPath); // send stream String result = callSocketCommand_Stream(socket, in); in.close(); - log.debug( "Response: " + result); + //log.debug( "Response: " + result); //System.out.println("Response: " + result); // parse return code - if (RESPONSEOK.equals(result)) { setStatus(Status.PASSED); log.info("scan of file '" + fileFullPath + "' passed"); } else if (result.endsWith(FOUND_SUFFIX)) { - if (result.contains(".Exploit.CVE")) { // we want to ignore CVE results - setStatus(Status.UNDETERMINED); - log.info("scan of file '" + fileFullPath + "' possibly failed, check manually if should be ignored!"); - } else if (result.contains("Eicar-Signature")) { // we want to ignore EICAR - setStatus(Status.UNDETERMINED); + if (result.contains("Eicar-Signature")) { // we want to ignore EICAR log.info("scan of file '" + fileFullPath + "' possibly failed, because EICAR sequence detected, check manually if should be ignored!"); } else { - setStatus(Status.FAILED); log.info("scan of file '" + fileFullPath + "' failed"); } setSignature(result.substring(STREAM_PREFIX.length(), result.lastIndexOf(FOUND_SUFFIX) - 1)); } else { - setStatus(Status.UNDETERMINED); log.warn("clamd protocol not fully implemented, result='" + result + "'"); //System.out.println("clamd protocol not fully implemented"); } } catch (IOException e) { log.error("exception creation socket in scan(), clamd not available at host=" + host + "port=" + port, e); //System.out.println("exception creation socket, clamd not available at host=" + host + "port=" + port + " " + e); - setStatus(Status.UNDETERMINED); setSignature("ERROR: clamd not available"); } }