Skip to content

Commit

Permalink
Escape the distributed contribution command settings (#653)
Browse files Browse the repository at this point in the history
* update install.md by adding the missing ```. (#649)

* Escape the distributed contribution command settings

Fields passed to the distributed contribution command were unescaped,
which caused some parameters (such as passwords) to close the command
quote early.

---------

Co-authored-by: hiuxia <98009342+hiuxia@users.noreply.github.com>
  • Loading branch information
espadrine and hiuxia authored Aug 26, 2023
1 parent da04863 commit 016b22d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion katrain/core/contribute_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self, katrain):
self.max_buffer_games = 2 * settings_dict["maxSimultaneousGames"]
settings = {f"{k}={v}" for k, v in settings_dict.items()}
self.command = shlex.split(
f'"{exe}" contribute -config "{cfg}" -base-dir "{base_dir}" -override-config "{",".join(settings)}"'
f'"{exe}" contribute -config "{cfg}" -base-dir "{base_dir}" -override-config {shlex.quote(",".join(settings))}'
)
self.start()

Expand Down

0 comments on commit 016b22d

Please sign in to comment.