Skip to content

Commit

Permalink
Merge pull request #3307 from Ali-Razmjoo/fix-shell-command
Browse files Browse the repository at this point in the history
Fix unsafe shell command in luigi/contrib/lsf.py
  • Loading branch information
dlstadther authored Sep 5, 2024
2 parents 38dbd88 + 31e5c9f commit c9a0d20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions luigi/contrib/lsf.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def track_job(job_id):
- "EXIT"
based on the LSF documentation
"""
cmd = "bjobs -noheader -o stat {}".format(job_id)
cmd = ["bjobs", "-noheader", "-o", "stat", str(job_id)]
track_job_proc = subprocess.Popen(
cmd, stdout=subprocess.PIPE, shell=True)
cmd, stdout=subprocess.PIPE, shell=False)
status = track_job_proc.communicate()[0].strip('\n')
return status

Expand Down

0 comments on commit c9a0d20

Please sign in to comment.