diff options
| author | jvoisin | 2011-09-22 18:17:49 +0200 |
|---|---|---|
| committer | jvoisin | 2011-09-22 18:17:49 +0200 |
| commit | 51145d73da291e52b626bdf6a55b4a047af688d1 (patch) | |
| tree | fe4b0b39c2b51828e05f047a4acf436b9cd50f52 | |
| parent | dab7faf9f994e6cafa914e515396a537ce2a61ab (diff) | |
Remove a useless function
| -rw-r--r-- | mat/mat.py | 15 |
1 files changed, 3 insertions, 12 deletions
| @@ -132,23 +132,14 @@ def secure_remove(filename): | |||
| 132 | logging.error('Unable to remove %s' % filename) | 132 | logging.error('Unable to remove %s' % filename) |
| 133 | 133 | ||
| 134 | 134 | ||
| 135 | def is_secure(filename): | ||
| 136 | ''' | ||
| 137 | Prevent shell injection | ||
| 138 | ''' | ||
| 139 | if not(os.path.isfile(filename)): # check if the file exist | ||
| 140 | logging.error('%s is not a valid file' % filename) | ||
| 141 | return False | ||
| 142 | else: | ||
| 143 | return True | ||
| 144 | |||
| 145 | |||
| 146 | def create_class_file(name, backup, add2archive): | 135 | def create_class_file(name, backup, add2archive): |
| 147 | ''' | 136 | ''' |
| 148 | return a $FILETYPEStripper() class, | 137 | return a $FILETYPEStripper() class, |
| 149 | corresponding to the filetype of the given file | 138 | corresponding to the filetype of the given file |
| 150 | ''' | 139 | ''' |
| 151 | if not is_secure(name): | 140 | if not os.path.isfile(name): |
| 141 | # check if the file exists | ||
| 142 | logging.error('%s is not a valid file' % name) | ||
| 152 | return | 143 | return |
| 153 | 144 | ||
| 154 | filename = '' | 145 | filename = '' |
