diff --git a/beeflow/client/bee_client.py b/beeflow/client/bee_client.py index 3a536e0f5..d4d5c0f93 100644 --- a/beeflow/client/bee_client.py +++ b/beeflow/client/bee_client.py @@ -260,6 +260,12 @@ def is_parent(parent, path): if not os.path.exists(workdir): error_exit(f"Workflow working directory \"{workdir}\" doesn't exist") + # Make sure the workdir is not in /var or /var/tmp + if os.path.commonpath([os.path.realpath('/tmp'), workdir]) == os.path.realpath('/tmp'): + error_exit("Workflow working directory cannot be in \"/tmp\"") + if os.path.commonpath([os.path.realpath('/var/tmp'), workdir]) == os.path.realpath('/var/tmp'): + error_exit("Workflow working directory cannot be in \"/var/tmp\"") + # TODO: Can all of this information be sent as a file? data = { 'wf_name': wf_name.encode(),