summaryrefslogtreecommitdiff
path: root/libmat/archive.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmat/archive.py')
-rw-r--r--libmat/archive.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/libmat/archive.py b/libmat/archive.py
index 8a3fee9..426dcf9 100644
--- a/libmat/archive.py
+++ b/libmat/archive.py
@@ -44,6 +44,7 @@ class GenericArchiveStripper(parser.GenericParser):
44 44
45 def is_clean(self, list_unsupported=False): 45 def is_clean(self, list_unsupported=False):
46 """ Virtual method to check for harmul metadata 46 """ Virtual method to check for harmul metadata
47 :param bool list_unsupported:
47 """ 48 """
48 raise NotImplementedError 49 raise NotImplementedError
49 50
@@ -157,6 +158,10 @@ class ZipStripper(GenericArchiveStripper):
157 files starting with "begining_blacklist", or ending with 158 files starting with "begining_blacklist", or ending with
158 "ending_blacklist". This method also add files present in 159 "ending_blacklist". This method also add files present in
159 whitelist to the archive. 160 whitelist to the archive.
161
162 :param list whitelist: Add those files to the produced archive, regardless if they are harmful or not
163 :param list beginning_blacklist: If the file starts with $ending_blacklist, it will _not_ be added
164 :param list ending_blacklist: If the file end with $ending_blacklist, it will _not_ be added
160 """ 165 """
161 if not ending_blacklist: 166 if not ending_blacklist:
162 ending_blacklist = [] 167 ending_blacklist = []
@@ -222,6 +227,8 @@ class TarStripper(GenericArchiveStripper):
222 """ Remove all harmful metadata from the tarfile. 227 """ Remove all harmful metadata from the tarfile.
223 The method will also add every files matching 228 The method will also add every files matching
224 whitelist in the produced archive. 229 whitelist in the produced archive.
230 :param list whitelist: Files to add the to produced archive,
231 regardless if they are considered harmfull.
225 """ 232 """
226 if not whitelist: 233 if not whitelist:
227 whitelist = [] 234 whitelist = []
@@ -257,6 +264,7 @@ class TarStripper(GenericArchiveStripper):
257 @staticmethod 264 @staticmethod
258 def is_file_clean(current_file): 265 def is_file_clean(current_file):
259 """ Check metadatas added by tarfile 266 """ Check metadatas added by tarfile
267 :param tarfile.TarInfo current_file:
260 """ 268 """
261 if current_file.mtime != 0: 269 if current_file.mtime != 0:
262 return False 270 return False
@@ -275,6 +283,7 @@ class TarStripper(GenericArchiveStripper):
275 When list_unsupported is True, the method returns a list 283 When list_unsupported is True, the method returns a list
276 of all non-supported/archives files contained in the 284 of all non-supported/archives files contained in the
277 archive. 285 archive.
286 :param bool list_unsupported:
278 """ 287 """
279 ret_list = [] 288 ret_list = []
280 tarin = tarfile.open(self.filename, 'r' + self.compression) 289 tarin = tarfile.open(self.filename, 'r' + self.compression)