Turn off copying for certain mimes in filecheck

pull/12/head
Dan Puttick 2017-03-09 01:41:42 -05:00
parent 18857da7ca
commit 484c71fc86
2 changed files with 5 additions and 0 deletions

View File

@ -205,18 +205,22 @@ class File(FileBase):
self.add_file_string('Symlink to {}'.format(symlink_path))
else:
self.add_file_string('Inode file')
self.should_copy = False
def unknown(self):
"""Main type should never be unknown."""
self.add_file_string('Unknown file')
self.should_copy = False
def example(self):
"""Used in examples, should never be returned by libmagic."""
self.add_file_string('Example file')
self.should_copy = False
def multipart(self):
"""Used in web apps, should never be returned by libmagic"""
self.add_file_string('Multipart file')
self.should_copy = False
# ##### Treated as malicious, no reason to have it on a USB key ######
def message(self):

View File

@ -321,6 +321,7 @@ class KittenGroomerBase(object):
dst_path, filename = os.path.split(dst)
self.safe_mkdir(dst_path)
shutil.copy(src, dst)
self.set_property('copied', True)
except Exception as e:
self.add_error(e, '')