Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bug 403023: Extract NSIS (windows) installers and MAR files when viru…

…s scanning - extract to a temp dir containing the full path to the original file. r=catlee/justdave
  • Loading branch information...
commit 133a001175a3ffa8a60cb0fb17b74307b8de37ab 1 parent f719417
@bhearsum bhearsum authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 stage/extract_and_run_command.py
View
11 stage/extract_and_run_command.py
@@ -56,7 +56,7 @@ def find_files(d):
"""yields all of the files in `d'"""
for root, dirs, files in os.walk(d):
for f in files:
- yield path.join(root, f)
+ yield path.abspath(path.join(root, f))
def rchmod(d, mode=0755):
"""chmods everything in `d' to `mode', including `d' itself"""
@@ -74,10 +74,13 @@ def maybe_extract(filename):
ext = path.splitext(filename)[1]
if ext not in EXTRACTORS.keys():
return None
- tempdir = tempfile.mkdtemp()
+ # Append the full filepath to the tempdir
+ tempdir_root = tempfile.mkdtemp()
+ tempdir = path.join(tempdir_root, filename.lstrip('/'))
+ os.makedirs(tempdir)
EXTRACTORS[ext](filename, tempdir)
- rchmod(tempdir)
- return tempdir
+ rchmod(tempdir_root)
+ return tempdir_root
def process(item, command):
def format_time(t):
Please sign in to comment.
Something went wrong with that request. Please try again.