Use sudo for package auditing
This commit is contained in:
@@ -51,8 +51,13 @@ pub fn upgrade_packages(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn audit_packages() -> Result<(), failure::Error> {
|
||||
pub fn audit_packages(sudo: &Option<PathBuf>) -> Result<(), failure::Error> {
|
||||
if let Some(sudo) = sudo {
|
||||
println!();
|
||||
Command::new("/usr/sbin/pkg").args(&["audit", "-Fr"]).spawn()?.wait()?;
|
||||
Command::new(sudo)
|
||||
.args(&["/usr/sbin/pkg", "audit", "-Fr"])
|
||||
.spawn()?
|
||||
.wait()?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ fn run() -> Result<(), Error> {
|
||||
}
|
||||
|
||||
#[cfg(target_os = "freebsd")]
|
||||
freebsd::audit_packages().ok();
|
||||
freebsd::audit_packages(&sudo).ok();
|
||||
}
|
||||
|
||||
if report.data().iter().all(|(_, succeeded)| *succeeded) {
|
||||
|
||||
Reference in New Issue
Block a user