Skip to content

Commit

Permalink
Use cap-std's new read_link_contents function.
Browse files Browse the repository at this point in the history
The read_link function refuses to return the value of a symlink if it's
absolute.  But read_link_contents will allow that.
  • Loading branch information
asomers authored and hannesdejager committed Aug 25, 2024
1 parent 3b6a1d2 commit e0e7b33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/unftp-sbe-fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "../../" }
Expand Down
4 changes: 2 additions & 2 deletions crates/unftp-sbe-fs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<User: UserDetail> StorageBackend<User> 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
Expand Down Expand Up @@ -143,7 +143,7 @@ impl<User: UserDetail> StorageBackend<User> 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
Expand Down

0 comments on commit e0e7b33

Please sign in to comment.