From 7d5630e3316816e4247f0fedfd24c260b882132a Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Tue, 14 May 2024 10:38:29 -0600 Subject: [PATCH] Use cap-std's new read_link_contents function. The read_link function refuses to return the value of a symlink if it's absolute. But read_link_contents will allow that. --- crates/unftp-sbe-fs/Cargo.toml | 2 +- crates/unftp-sbe-fs/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/unftp-sbe-fs/Cargo.toml b/crates/unftp-sbe-fs/Cargo.toml index ed775e5f..d6412ecd 100644 --- a/crates/unftp-sbe-fs/Cargo.toml +++ b/crates/unftp-sbe-fs/Cargo.toml @@ -21,7 +21,7 @@ readme = "README.md" [dependencies] async-trait = "0.1.80" cfg-if = "1.0" -cap-std = "3.0" +cap-std = "3.1" futures = { version = "0.3.30", default-features = false, features = ["std"] } lazy_static = "1.4.0" libunftp = { version = "0.20.1", path = "../../" } diff --git a/crates/unftp-sbe-fs/src/lib.rs b/crates/unftp-sbe-fs/src/lib.rs index 296a1e2c..fb0096f4 100644 --- a/crates/unftp-sbe-fs/src/lib.rs +++ b/crates/unftp-sbe-fs/src/lib.rs @@ -114,7 +114,7 @@ impl StorageBackend for Filesystem { .await .map_err(|_| Error::from(ErrorKind::PermanentFileNotAvailable))?; let target = if fs_meta.is_symlink() { - match self.root_fd.read_link(path) { + match self.root_fd.read_link_contents(path) { Ok(p) => Some(p), Err(_e) => { // XXX We should really log an error here. But a logger object is not @@ -143,7 +143,7 @@ impl StorageBackend for Filesystem { let fullpath = path.join(entry_path.clone()); cap_fs::symlink_metadata(self.root_fd.clone(), fullpath.clone()).map_ok(move |meta| { let target = if meta.is_symlink() { - match self.root_fd.read_link(&fullpath) { + match self.root_fd.read_link_contents(&fullpath) { Ok(p) => Some(p), Err(_e) => { // XXX We should really log an error here. But a logger object is