From e20035e325900cfcc57177cf2012f85dbaa63b12 Mon Sep 17 00:00:00 2001 From: Dan Puttick Date: Fri, 4 Aug 2017 16:31:52 -0400 Subject: [PATCH] Fix description for ooxml files --- bin/filecheck.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/filecheck.py b/bin/filecheck.py index 61dcbfe..c3f2776 100644 --- a/bin/filecheck.py +++ b/bin/filecheck.py @@ -219,12 +219,10 @@ class File(FileBase): for mt in Config.mimes_rtf: if mt in self.subtype: self.add_description('Rich Text (rtf) file') - # TODO: need a way to convert it to plain text self.force_ext('.txt') return for mt in Config.mimes_ooxml: if mt in self.subtype: - self.add_description('OOXML (openoffice) file') self._ooxml() return self.add_description('Plain text file') @@ -240,7 +238,6 @@ class File(FileBase): def _executables(self): """Process an executable file.""" - # LOG: change the processing_type property to some other name or include in file_string self.make_dangerous('Executable file') def _winoffice(self): @@ -275,6 +272,7 @@ class File(FileBase): def _ooxml(self): """Process an ooxml file.""" + self.add_description('OOXML (openoffice) file') try: doc = officedissector.doc.Document(self.src_path) except Exception: @@ -292,6 +290,7 @@ class File(FileBase): if len(doc.features.embedded_packages) > 0: self.make_dangerous('Ooxml file with embedded packages') + def _libreoffice(self): """Process a libreoffice file.""" # As long as there is no way to do a sanity check on the files => dangerous @@ -312,7 +311,6 @@ class File(FileBase): """Process a PDF file.""" xmlDoc = PDFiD(self.src_path) oPDFiD = cPDFiD(xmlDoc, True) - # TODO: are there other pdf characteristics which should be dangerous? if oPDFiD.encrypt.count > 0: self.make_dangerous('Encrypted pdf') if oPDFiD.js.count > 0 or oPDFiD.javascript.count > 0: @@ -437,7 +435,6 @@ class File(FileBase): using PIL.Image, saves it to the temporary directory, and copies it to the destination. """ - # TODO: make sure this method works for png, gif, tiff if self.has_metadata: self.extract_metadata() tempdir_path = self.make_tempdir()