# HG changeset patch # User jdv # Date 1507078319 14400 # Node ID 3f35881c2e2585e8877ba9a28ce5706684d5f5b7 # Parent 57447db0ec78e316aed05eb869a522e89b61a7c2 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/nanonet commit d8cc434bd1704b2834f89b7d91370f356e3ac85a diff -r 57447db0ec78 -r 3f35881c2e25 nanonet_1D.py --- a/nanonet_1D.py Fri Sep 08 11:03:35 2017 -0400 +++ b/nanonet_1D.py Tue Oct 03 20:51:59 2017 -0400 @@ -2,7 +2,6 @@ import sys, os import glob -import tarfile import subprocess import shutil import h5py @@ -28,8 +27,15 @@ if not os.path.exists(in_dir): os.makedirs(in_dir) - tar = tarfile.open(fn, mode='r') - tar.extractall(path=in_dir) + # python's tarfile interface does not sanitize file paths within + # tarballs, which can be a big security risk. GNU tar does sanitize by + # default, so it's easier/safer here just to call the system tar + subprocess.call([ + "tar", + "-xf", + fn, + "-C", + in_dir]) files = glob.glob( os.path.join(in_dir, "**", "*.fast5"),