Skip to content

Commit

Permalink
shell security problem
Browse files Browse the repository at this point in the history
  • Loading branch information
GBenedett committed Apr 16, 2024
1 parent 709ef23 commit 45c1985
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions ceasiompy/CPACS2GMSH/func/RANS_mesh_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,18 +318,17 @@ def pentagrow_3d_mesh(
current_dir = os.getcwd()
os.chdir(current_dir)

command = "pentagrow mesh_2d.stl config.cfg"

# command = "pentagrow mesh_2d.stl config.cfg"
command = ["pentagrow", "mesh_2d.stl", "config.cfg"]
# Specify the file path
file_path = "command.txt" # You can change the file path as needed
file_path = "command.txt"

# Write the command to the file
with open(file_path, "w") as file:
file.write(command)
command_str = " ".join(command)

# log.info(f"Command written to: {file_path}")
with open(file_path, "w") as file:
file.write(command_str)

subprocess.call(command, shell=True, cwd=current_dir, start_new_session=False)
subprocess.call(command, cwd=current_dir, start_new_session=False)

mesh_path = Path(result_dir, "hybrid.su2")
log.info(f"Mesh path:{mesh_path}")
Expand Down

0 comments on commit 45c1985

Please sign in to comment.