From 784e9ee24d977c99dcb5ba5aef81dae48cb899fb Mon Sep 17 00:00:00 2001 From: Roman Melnikov Date: Wed, 19 Apr 2023 17:46:43 +0800 Subject: [Chore] Handle 'temp_path' as an actual 'Path' instead of 'String' Problem: 'temp_path' and 'lock_path' are handled as 'String'. This can be a problem when the 'temp_path' directory is a symlink on the target system, e.g. this is the case with the default '/tmp' and macOS, where this directory is actually a symlink to '/private/tmp'. Solution: Handle 'temp_path' and 'lock_path' as actual Paths. Also, canonicalize 'temp_path' to avoid canary file path mismatches when checking filesystem events. As a side effect, also update the 'notify' dependency to the latest stable version. --- src/data.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/data.rs') diff --git a/src/data.rs b/src/data.rs index 90ea331..3b3e2c9 100644 --- a/src/data.rs +++ b/src/data.rs @@ -5,6 +5,7 @@ use merge::Merge; use serde::Deserialize; use std::collections::HashMap; +use std::path::PathBuf; #[derive(Deserialize, Debug, Clone, Merge)] pub struct GenericSettings { @@ -25,7 +26,7 @@ pub struct GenericSettings { #[serde(rename(deserialize = "confirmTimeout"))] pub confirm_timeout: Option, #[serde(rename(deserialize = "tempPath"))] - pub temp_path: Option, + pub temp_path: Option, #[serde(rename(deserialize = "magicRollback"))] pub magic_rollback: Option, #[serde(rename(deserialize = "sudo"))] -- cgit v1.2.3