Crate jailer

Crate jailer 

Source
Expand description

Crate for creating sandbox environments to perform actions in isolation.

This crate provides two main types:

  • Jailer: A simple sandbox that changes the current working directory into a temporary one. When dropped or closed, it restores the original directory and cleans up the temporary space.
  • EnvJailer: Extends Jailer by also managing environment variables, allowing preservation of selected variables while clearing others on exit.

Both types are thread-safe and ensure only one instance runs at a time via a global mutex.

Structsยง

EnvJailer
EnvJailer struct which creates a jail environment with environment variable management.
Jailer
Jailer struct which creates a jail environment.