Skip to content

Commit de30697

Browse files
authored
Merge pull request #6 from CMCC-Foundation/no-shell
Adding #nosec to trusted subprocess lines
2 parents f9e3654 + 2b5c3df commit de30697

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ def run_medslik_sim(self, simdir, simname, separate_slicks=False):
367367
# Compile and start running (replacing `cd` with `cwd`)
368368
compile_script = "MODEL_SRC/compile.sh"
369369
run_script = "RUN.sh"
370-
subprocess.run(["sh", compile_script], check=True, cwd=os.path.join(model_dir, "RUN"))
371-
subprocess.run(["./" + run_script], check=True, cwd=os.path.join(model_dir, "RUN"))
370+
subprocess.run(["sh", compile_script], check=True, cwd=os.path.join(model_dir, "RUN")) # nosec
371+
subprocess.run(["./" + run_script], check=True, cwd=os.path.join(model_dir, "RUN")) # nosec
372372

373373
else:
374374
# Handle separate slicks
@@ -391,8 +391,8 @@ def run_medslik_sim(self, simdir, simname, separate_slicks=False):
391391
# Compile and start running
392392
compile_script = "MODEL_SRC/compile.sh"
393393
run_script = "RUN.sh"
394-
subprocess.run(["sh", compile_script], check=True, cwd=os.path.join(model_dir, "RUN"))
395-
subprocess.run(["./" + run_script], check=True, cwd=os.path.join(model_dir, "RUN"))
394+
subprocess.run(["sh", compile_script], check=True, cwd=os.path.join(model_dir, "RUN")) # nosec
395+
subprocess.run(["./" + run_script], check=True, cwd=os.path.join(model_dir, "RUN")) # nosec
396396

397397
# Copy output files (replacing `cp -r`)
398398
output_dest = os.path.join(simdir, simname, "out_files")

src/plot/plot_mdk3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def create_gif(self):
181181
{self.out_figures}/oil_concentration_{self.config['simulation']['name']}.gif"
182182
],
183183
# shell=True,
184-
)
184+
) # nosec
185185

186186
def plot_pyngl(
187187
self,
@@ -210,7 +210,7 @@ def plot_pyngl(
210210
],
211211
# shell=True,
212212
check=True,
213-
)
213+
) # nosec
214214

215215

216216
if __name__ == "__main__":

0 commit comments

Comments
 (0)