| 431 | // because we do expect /etc/hostname to be injected as |
| 432 | .set_root_type(RootType::Alternative); |
| 433 | fn check_buildah_injected(root: &Dir, _config: &LintExecutionConfig) -> LintResult { |
| 434 | const RUNTIME_INJECTED: &[&str] = &["etc/hostname", "etc/resolv.conf"]; |
| 435 | for ent in RUNTIME_INJECTED { |
| 436 | if let Some(meta) = root.symlink_metadata_optional(ent)? { |
| 437 | if meta.is_file() && meta.size() == 0 { |
| 438 | return lint_err(format!( |
| 439 | "/{ent} is an empty file; this may have been synthesized by a container runtime." |
| 440 | )); |
| 441 | } |
| 442 | } |
| 443 | } |
| 444 | lint_ok() |
| 445 | } |
| 446 | |
| 447 | #[distributed_slice(LINTS)] |
| 448 | static LINT_ETC_USRUSETC: Lint = Lint::new_fatal( |