Fix sendmail executable permission check (#7483)

* Fix sendmail executable permission check

* Use access check for sendmail command
This commit is contained in:
Patrick Bönisch
2026-08-20 17:34:38 +02:00
committed by GitHub
parent 0cefa4cca7
commit 9e78911a2f
3 changed files with 22 additions and 5 deletions
+2 -5
View File
@@ -1162,11 +1162,8 @@ fn validate_config(cfg: &ConfigItems, on_update: bool) -> Result<(), Error> {
}
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
if !metadata.permissions().mode() & 0o111 != 0 {
err!(format!("sendmail command at `{path:?}` isn't executable"));
}
if nix::unistd::access(&path, nix::unistd::AccessFlags::X_OK).is_err() {
err!(format!("sendmail command at `{path:?}` isn't executable"));
}
}
}