Unable to install challenges with the same name (but different category)
tieknimmers opened this issue · 1 comments
The function install()
in ctfcli/cli/challenge.py
implements a check to see if there is already a challenge with the same name. This check does this as follows:
if c["name"] == challenge["name"]:
click.secho(
"Already found existing challenge with same name. Perhaps you meant sync instead of install?",
fg="red",
)
As a result, ctfcli
refuses to install challenges with the same name regardless of the category.
I have been using a modified variant of ctfcli
that determines if a challenge is already present based on the challenge name and challenge category.
if c["name"] == challenge["name"] and c["category"] == challenge["category"]:
click.secho(
"Already found existing challenge with same name. Perhaps you meant sync instead of install?",
fg="red",
)
The same check is also present in the function sync_challenge()
in ctfcli/utils/challenge.py
and should be changed in similar fashion to sync the correct challenge.
I guess this is the intended/expected behaviour?
Yes the behavior is as intended but there are definitely better ways to determine if a challenge is already installed.
However Im not sure if category is a good additional check b/c what if you were to change the category of a challenge? You would end up with two challenges instead of one.