summaryrefslogtreecommitdiff
path: root/lib/mat.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mat.py')
-rw-r--r--lib/mat.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/mat.py b/lib/mat.py
index 9624511..c9547c1 100644
--- a/lib/mat.py
+++ b/lib/mat.py
@@ -6,6 +6,7 @@
6 6
7import sys 7import sys
8import os 8import os
9import subprocess
9 10
10import hachoir_core.cmd_line 11import hachoir_core.cmd_line
11import hachoir_parser 12import hachoir_parser
@@ -29,6 +30,17 @@ strippers = {
29 hachoir_parser.archive.bzip2_parser.Bzip2Parser: archive.Bzip2Stripper, 30 hachoir_parser.archive.bzip2_parser.Bzip2Parser: archive.Bzip2Stripper,
30} 31}
31 32
33def secure_remove(filename):
34 '''
35 securely remove the file
36 '''
37 #FIXME : Vulnerable to shell injection ?
38 try:
39 subprocess.call('shred --remove %s' % filename, shell=True)
40 except:
41 print('Unable to remove %s' % filename)
42
43
32def is_secure(filename): 44def is_secure(filename):
33 ''' 45 '''
34 Prevent shell injection 46 Prevent shell injection