Skip to content

Commit 44c29d7

Browse files
committed
complete output dir isolation
1 parent ae5fed3 commit 44c29d7

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/cli/args.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ pub struct CliArgs {
4949
#[arg(short = 'c', long, global = true)]
5050
pub threads: Option<usize>,
5151

52+
pub output_dir: Option<PathBuf>,
53+
5254
// Ouch and claps subcommands
5355
#[command(subcommand)]
5456
pub cmd: Subcommand,

src/main.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ pub mod utils;
1010
pub mod sandbox;
1111

1212
use std::{env, path::PathBuf};
13-
14-
use log::{error, warn, info};
13+
use std::path::Path;
14+
//use log::{error, warn, info};
1515

1616
use cli::CliArgs;
1717
use once_cell::sync::Lazy;
@@ -62,28 +62,28 @@ fn run() -> Result<()> {
6262
fn init_sandbox(allowed_dir: &Path) {
6363

6464
if std::env::var("CI").is_ok() {
65-
warn!("Landlock sandboxing is disabled in CI environments.");
65+
// warn!("Landlock sandboxing is disabled in CI environments.");
6666
return;
6767
}
6868

6969

7070
if utils::landlock_support::is_landlock_supported() {
71-
info!("Landlock is supported and can be enabled.");
71+
// info!("Landlock is supported and can be enabled.");
7272

7373
let path_str = allowed_dir.to_str().expect("Cannot convert path");
7474
match sandbox::restrict_paths(&[path_str]) {
7575
Ok(status) => {
76-
if !status.is_restricted() {
77-
warn!("Landlock restriction was not successfully applied.");
78-
}
76+
// if !status.is_restricted() {
77+
// warn!("Landlock restriction was not successfully applied.");
78+
// }
7979
}
8080
Err(e) => {
81-
error!("Failed to build the Landlock ruleset: {e}");
81+
// error!("Failed to build the Landlock ruleset: {e}");
8282
std::process::exit(EXIT_FAILURE);
8383
}
8484
}
8585
} else {
86-
warn!("Landlock is NOT supported on this platform or kernel (<5.19).");
86+
// warn!("Landlock is NOT supported on this platform or kernel (<5.19).");
8787
}
8888

8989
}

0 commit comments

Comments
 (0)