mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-10-27 08:30:13 +00:00
Fix sendmail executable permission check (#7483)
* Fix sendmail executable permission check * Use access check for sendmail command
This commit is contained in:
1 parent
0cefa4cca7
commit
9e78911a2f
3 files changed
+22
-5
No files matched your search
+2
-5
@@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user