Skip to content

Commit

Permalink
Fix insecure subprocess run
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Dec 17, 2023
1 parent e093c5e commit 357973e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,14 @@ def _strip_unneeded_symbols() -> None:
print("Stripping unneeded symbols from binaries...")
for so in itertools.chain(Path("nautilus_trader").rglob("*.so")):
if platform.system() == "Linux":
strip_cmd = f"strip --strip-unneeded {so}"
strip_cmd = ["strip", "--strip-unneeded", so]
elif platform.system() == "Darwin":
strip_cmd = f"strip -x {so}"
strip_cmd = ["strip", "-x", so]
else:
raise RuntimeError(f"Cannot strip symbols for platform {platform.system()}")
subprocess.run(
strip_cmd,
strip_cmd, # type: ignore [arg-type] # noqa
check=True,
shell=True, # noqa
capture_output=True,
)
except subprocess.CalledProcessError as e:
Expand Down

0 comments on commit 357973e

Please sign in to comment.