Sanitize inputs to eval() (#6745)

This commit is contained in:
Logan Adams
2024-11-13 09:04:56 -08:00
committed by GitHub
parent 877aa0dba6
commit 9a2c209cee

View File

@ -160,8 +160,11 @@ run_cmd="deepspeed.pt \
--master_port ${master_port} --master_port ${master_port}
${BingBertSquad_script} ${other_args} ${squad_args}" ${BingBertSquad_script} ${other_args} ${squad_args}"
echo ${run_cmd} # Sanitize input before running eval()
eval ${run_cmd} safe_cmd=$(printf '%q' "$run_cmd")
echo ${safe_cmd}
eval ${safe_cmd}
set +x set +x