From 74ee25aa1a4e228444b9e8db40e223aa548a5d9a Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Fri, 27 Nov 2020 11:47:21 -0800 Subject: [PATCH] Ensure that the cache directory for the agent is always absolute This ensures that caches are not mistakenly referred to within the pipeline work directory --- cli/agent/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/agent/src/main.rs b/cli/agent/src/main.rs index d04f563..76a3272 100644 --- a/cli/agent/src/main.rs +++ b/cli/agent/src/main.rs @@ -63,7 +63,7 @@ async fn main() -> std::io::Result<()> { mkdir_if_not_exists(&work_dir)?; mkdir_if_not_exists(&cache_dir)?; - std::env::set_var("CACHES_DIR", cache_dir); + std::env::set_var("CACHES_DIR", cache_dir.canonicalize().expect("Failed to canonicalize cache directory")); std::env::set_current_dir(work_dir)?; let (sender, receiver) = channel(MAX_CONTROL_MSGS);