Potential catch for if somehow a user sends a delete model with a .. in it.

This commit is contained in:
ebolam 2022-06-14 19:30:01 -04:00
parent 899f191b51
commit f444ad851f
1 changed files with 1 additions and 1 deletions

View File

@ -3097,7 +3097,7 @@ def get_message(msg):
else: else:
get_model_info(vars.model) get_model_info(vars.model)
elif(msg['cmd'] == 'delete_model'): elif(msg['cmd'] == 'delete_model'):
if "{}/models".format(os.getcwd()) in msg['data'] or "{}\\models".format(os.getcwd()) in msg['data']: if "{}/models".format(os.getcwd()) in os.path.abspath(msg['data']) or "{}\\models".format(os.getcwd()) in os.path.abspath(msg['data']):
if check_if_dir_is_model(msg['data']): if check_if_dir_is_model(msg['data']):
print("It's a model, now we really will kill it") print("It's a model, now we really will kill it")
import shutil import shutil