From 23fc785ae4ed40d09c0f21ed813a47daeb04c000 Mon Sep 17 00:00:00 2001 From: yuhui Date: Fri, 24 Jan 2025 17:28:59 +0800 Subject: [PATCH] Update --- clients/filesystem-fuse/src/main.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clients/filesystem-fuse/src/main.rs b/clients/filesystem-fuse/src/main.rs index 9b9aea394c8..90a26803304 100644 --- a/clients/filesystem-fuse/src/main.rs +++ b/clients/filesystem-fuse/src/main.rs @@ -34,6 +34,7 @@ use tokio::signal::unix::{signal, SignalKind}; fn init_work_dirs(config: &AppConfig, mount_point: &str) -> io::Result<()> { let data_dir_name = Path::new(&config.fuse.data_dir).to_path_buf(); + let data_dir_name = data_dir_name.canonicalize()?; if !data_dir_name.exists() { Err(io::Error::new( io::ErrorKind::NotFound, @@ -183,6 +184,16 @@ fn main() -> Result<(), i32> { }; let app_config = app_config.unwrap(); + let mount_point = { + let path = Path::new(&mount_point).canonicalize(); + if let Err(e) = path { + error!("Failed to resolve mount point: {:?}", e); + return Err(-1); + }; + let path = path.unwrap(); + path.to_string_lossy().to_string() + }; + let result = init_work_dirs(&app_config, &mount_point); if let Err(e) = result { error!("Failed to initialize working directories: {:?}", e);