Skip to content

Commit

Permalink
Merge branch 'main' of github.com:stalwartlabs/mail-server
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Oct 16, 2024
2 parents a1dbd56 + 7b20647 commit 471a45a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/common/src/listener/listen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,13 @@ impl Listeners {
#[cfg(not(target_env = "msvc"))]
{
if let Ok(run_as_user) = std::env::var("RUN_AS_USER") {
let mut pd = privdrop::PrivDrop::default().user(run_as_user);
let mut pd = privdrop::PrivDrop::default()
.user(run_as_user)
.fallback_to_ids_if_names_are_numeric();
if let Ok(run_as_group) = std::env::var("RUN_AS_GROUP") {
pd = pd.group(run_as_group);
pd = pd
.group(run_as_group)
.fallback_to_ids_if_names_are_numeric();
}
pd.apply().failed("Failed to drop privileges");
}
Expand Down

0 comments on commit 471a45a

Please sign in to comment.