Skip to main content

resolve_link

Function resolve_link 

Source
pub fn resolve_link(
    vfs: &Vfs,
    cwd: &str,
    guest_path: &str,
) -> Result<LinkPath, ContainError>
Expand description

Resolve a guest path for an operation that acts on the link itself.

Opens the parent directory, so a parent component that escapes is refused here. The VFS root itself resolves to the root handle with a . name: it is not a link, so nothing is followed, and removing it fails at the OS as it should.

A mount point resolves the same way, to its volume’s handle with a . name, so it can be neither removed nor renamed like an entry of its parent.