Skip to content

Commit

Permalink
fix link path when not absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyuhui.807 committed Apr 29, 2024
1 parent 02b25b3 commit 9c7887d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rasp/librasp/src/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ impl RASPComm for ThreadMode {
let mut target = format!("{}{}", root_dir, linking_to);

let resolved_path = resolve_symlink_path(target.clone());
if resolved_path.as_str().starts_with(&root_dir) {
return Err(anyhow!("link bind path find failed: {}, pid {} may not exist", target, pid));
} else {
if !resolved_path.as_str().starts_with(&root_dir) {
target = format!("/proc/{}/root{}", pid ,resolved_path);
} else {
target = resolved_path;
}

// check socket exist
Expand Down

0 comments on commit 9c7887d

Please sign in to comment.