Skip to content

Commit

Permalink
Merge pull request #1503 from n0toose/uhyve-fix-unlink
Browse files Browse the repository at this point in the history
fix(uhyve): fix improper unlink string handling
  • Loading branch information
mkroening authored Dec 19, 2024
2 parents eef089a + b0afe95 commit a32834f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/fs/uhyve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,16 @@ impl VfsNode for UhyveDirectory {

fn traverse_unlink(&self, components: &mut Vec<&str>) -> io::Result<()> {
let path: String = if components.is_empty() {
"/".to_string()
"/\0".to_string()
} else {
components
let mut path: String = components
.iter()
.rev()
.map(|v| "/".to_owned() + v)
.collect()
.collect();
path.push('\0');
path.remove(0);
path
};

let mut sysunlink = SysUnlink::new(VirtAddr::from_ptr(path.as_ptr()));
Expand Down

0 comments on commit a32834f

Please sign in to comment.