-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jailer: use Rust-like strings for paths
jailer keeps track of various paths, e.g. device files under /dev. It represents these paths as C-like NULL terminated strings, because we use these paths while calling directly system calls. This requires us to do conversions between C-like and Rust-like strings quite often. This commit reverses the logic to store the paths as Rust strings and only convert them when we need to perform a system call, using the CString type. This is much safer (in terms of Rust-safety), it allows for more Rust-idiomatic code and requires less conversions along the way. Signed-off-by: Babis Chalios <[email protected]>
- Loading branch information
Showing
2 changed files
with
38 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters