Open nikoladze opened 5 years ago
import subprocess import shlex
prolog_command = [ '/full/path/to/your/prolog_script.sh', 'arg1', 'arg2', ]
escaped_command = ' '.join(shlex.quote(arg) for arg in prolog_command)
subprocess.Popen(escaped_command, shell=True, executable="/bin/bash")
Hi,
When i pass a file by the
--prolog
argument i get the error message:originating from the
subprocess.Popen
call in:https://github.com/soravux/scoop/blob/d391dfa62f47e49d48328ee9cf08aa114256fd33/scoop/launch/workerLaunch.py#L192-L195
The error seems to refer to the bash builtin
source
. When i run the above command withshell=True
andexecutable="/bin/bash"
it seems to workI'm aware this poses security risks and i have no overview which (potentially un-escaped) external inputs go into this command, so i'm not suggesting to just fix it in this way. Also i don't know if relying on bash is the only way to do this. Maybe somebody has an idea?
Cheers, Nikolai