Skip to content

Commit e7736bf

Browse files
authored
Merge pull request #1095 from cgwalters/lint-prep4
lints: More cleanup && lints: Check for invalid /etc/hostname and /etc/resolv.conf
2 parents 3cadf4a + 2ed97d4 commit e7736bf

File tree

4 files changed

+212
-81
lines changed

4 files changed

+212
-81
lines changed

Cargo.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ indoc = { workspace = true }
3333
libc = { workspace = true }
3434
liboverdrop = "0.1.0"
3535
libsystemd = "0.7"
36+
linkme = "0.3"
3637
openssl = { workspace = true }
3738
regex = "1.10.4"
3839
rustix = { workspace = true }

lib/src/cli.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,19 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
10481048
if list {
10491049
return lints::lint_list(std::io::stdout().lock());
10501050
}
1051+
let warnings = if fatal_warnings {
1052+
lints::WarningDisposition::FatalWarnings
1053+
} else {
1054+
lints::WarningDisposition::AllowWarnings
1055+
};
1056+
let root_type = if rootfs == "/" {
1057+
lints::RootType::Running
1058+
} else {
1059+
lints::RootType::Alternative
1060+
};
1061+
10511062
let root = &Dir::open_ambient_dir(rootfs, cap_std::ambient_authority())?;
1052-
lints::lint(root, fatal_warnings, std::io::stdout().lock())?;
1063+
lints::lint(root, warnings, root_type, std::io::stdout().lock())?;
10531064
Ok(())
10541065
}
10551066
},

0 commit comments

Comments
 (0)