Skip to main content

canonicalize

Function canonicalize 

Source
pub fn canonicalize(
    fs: &Fs,
    pid: u32,
    guest: &[u8],
    deref_final: bool,
) -> Result<Vec<u8>, i32>
Expand description

Canonicalizes an absolute guest path inside the guest namespace.

Unlike resolve, a path whose intermediate component is missing stays lexical from there on, as the binding table needs it.

§Arguments

  • fs - Guest filesystem view.
  • pid - Tracee thread id the path belongs to (for /proc/self).
  • guest - Absolute guest path, may contain ./../double slashes.
  • deref_final - Follow a symlink in the last component.

§Returns

The canonical absolute guest path (no ./../symlinks in the walked part).

§Errors

As resolve, except for a missing intermediate component.