Skip to content

Commit

Permalink
Fix security issue on collect_user_data.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmoura committed Jul 8, 2016
1 parent f7d18ed commit 44dec29
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions apprecommender/data_collect/collect_user_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
import logging
import os
import re
import subprocess
import tarfile
import time
import xapian

from subprocess import Popen, PIPE

from apprecommender.app_recommender import AppRecommender
from apprecommender.config import Config
from apprecommender.data import get_user_installed_pkgs
Expand Down Expand Up @@ -101,10 +100,10 @@ def collect_popcon_submission():

create_popularity_contest_file()

popcon = Popen('./popularity-contest',
shell=True, stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
popcon = subprocess.Popen('./popularity-contest',
shell=True, stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)

popcon_output = popcon.stdout.read()

Expand Down Expand Up @@ -412,7 +411,7 @@ def main():
collect_user_preferences()

make_tarfile(LOG_PATH + '.tar.gz', LOG_PATH)
commands.getoutput('rm -rf {}'.format(LOG_PATH))
subprocess.call(['rm', '-rf', LOG_PATH])

print "\n\nFinished: All files and recommendations were collected"
print "Collect data folder: {0}.tar.gz\n".format(LOG_PATH)
Expand Down

0 comments on commit 44dec29

Please sign in to comment.