mirror of https://github.com/CIRCL/PyCIRCLean
Turn off copying for certain mimes in filecheck
parent
18857da7ca
commit
484c71fc86
|
@ -205,18 +205,22 @@ class File(FileBase):
|
||||||
self.add_file_string('Symlink to {}'.format(symlink_path))
|
self.add_file_string('Symlink to {}'.format(symlink_path))
|
||||||
else:
|
else:
|
||||||
self.add_file_string('Inode file')
|
self.add_file_string('Inode file')
|
||||||
|
self.should_copy = False
|
||||||
|
|
||||||
def unknown(self):
|
def unknown(self):
|
||||||
"""Main type should never be unknown."""
|
"""Main type should never be unknown."""
|
||||||
self.add_file_string('Unknown file')
|
self.add_file_string('Unknown file')
|
||||||
|
self.should_copy = False
|
||||||
|
|
||||||
def example(self):
|
def example(self):
|
||||||
"""Used in examples, should never be returned by libmagic."""
|
"""Used in examples, should never be returned by libmagic."""
|
||||||
self.add_file_string('Example file')
|
self.add_file_string('Example file')
|
||||||
|
self.should_copy = False
|
||||||
|
|
||||||
def multipart(self):
|
def multipart(self):
|
||||||
"""Used in web apps, should never be returned by libmagic"""
|
"""Used in web apps, should never be returned by libmagic"""
|
||||||
self.add_file_string('Multipart file')
|
self.add_file_string('Multipart file')
|
||||||
|
self.should_copy = False
|
||||||
|
|
||||||
# ##### Treated as malicious, no reason to have it on a USB key ######
|
# ##### Treated as malicious, no reason to have it on a USB key ######
|
||||||
def message(self):
|
def message(self):
|
||||||
|
|
|
@ -321,6 +321,7 @@ class KittenGroomerBase(object):
|
||||||
dst_path, filename = os.path.split(dst)
|
dst_path, filename = os.path.split(dst)
|
||||||
self.safe_mkdir(dst_path)
|
self.safe_mkdir(dst_path)
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
|
self.set_property('copied', True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.add_error(e, '')
|
self.add_error(e, '')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue