Skip to content

Commit

Permalink
fix shell injection vulnerability in subprocess call (#2786)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkhakshoor committed Aug 2, 2020
1 parent c600ca6 commit 96eb6eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytorch_lightning/trainer/training_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ def sig_handler(self, signum, frame): # pragma: no-cover

# find job id
job_id = os.environ['SLURM_JOB_ID']
cmd = 'scontrol requeue {}'.format(job_id)
cmd = ['scontrol', 'requeue', job_id]

# requeue job
log.info(f'requeing job {job_id}...')
result = call(cmd, shell=True)
result = call(cmd)

# print result text
if result == 0:
Expand Down

0 comments on commit 96eb6eb

Please sign in to comment.