use super::Area;
use super::human::Place;
use super::rows::Report;
use crate::report::{Mark, Row};
use crate::sandbox::landlock::abi::{self, Kernel};
pub(super) fn rows(report: &mut Report, verbose: bool) {
if let Some(kernel) = crate::commands::run::landlock() {
landlock(report, &kernel, verbose);
}
for tier in crate::commands::run::score::tiers() {
let text = tier.line();
if tier.warns() {
report.note(&text);
} else {
report.line(Area::Sandbox, true, text);
}
}
}
fn landlock(report: &mut Report, kernel: &Kernel, verbose: bool) {
let text = format!("landlock {}", abi::summary(kernel));
if kernel.meets_floor() {
report.line(Area::Sandbox, true, text);
} else {
report.warn(&text);
}
if verbose {
for line in abi::lines(kernel) {
report.human(Place::Details, Row::new(Mark::Info, "Landlock", line));
}
}
}