From a6781fd4a99ee69096a7cd757fb20829ff4afa0f Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 9 Aug 2022 12:39:48 +0200 Subject: [PATCH] Canoncicalize node path before launching it --- binaries/coordinator/src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/binaries/coordinator/src/lib.rs b/binaries/coordinator/src/lib.rs index 15adabe9..210a9eb7 100644 --- a/binaries/coordinator/src/lib.rs +++ b/binaries/coordinator/src/lib.rs @@ -134,9 +134,14 @@ fn spawn_custom_node( communication: &dora_node_api::config::CommunicationConfig, ) -> eyre::Result>> { let mut args = node.run.split_ascii_whitespace(); - let cmd = args - .next() - .ok_or_else(|| eyre!("`run` field must not be empty"))?; + let cmd = { + let raw = Path::new( + args.next() + .ok_or_else(|| eyre!("`run` field must not be empty"))?, + ); + raw.canonicalize() + .wrap_err_with(|| format!("no node exists at `{}`", raw.display()))? + }; let mut command = tokio::process::Command::new(cmd); command.args(args);