Skip to content

Commit

Permalink
Require V2 landlock version
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-work committed Sep 1, 2023
1 parent 03eca37 commit 40ec500
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
use std::ffi::CString;
use std::fs;

#[cfg(target_os = "linux")]
use birdcage::linux::LANDLOCK_ABI;
use birdcage::{Birdcage, Exception, Sandbox};
#[cfg(target_os = "linux")]
use libc;
Expand Down Expand Up @@ -40,7 +42,7 @@ fn landlock_v3_truncate() {
fs::write(path, "truncate this").unwrap();

// Enable our sandbox.
let mut birdcage = Birdcage::new().unwrap();
let mut birdcage = Birdcage::new_with_version(LANDLOCK_ABI::V2).unwrap();
birdcage.add_exception(Exception::Write(path.into())).unwrap();
birdcage.add_exception(Exception::Read(path.into())).unwrap();
birdcage.lock().unwrap();
Expand Down

0 comments on commit 40ec500

Please sign in to comment.