aquatic_common: fix clippy warnings

This commit is contained in:
Joakim Frostegård 2024-01-20 10:37:15 +01:00
parent 746aa47cce
commit 2dd3ab8682
6 changed files with 23 additions and 23 deletions

View file

@ -48,15 +48,13 @@ impl PrivilegeDropper {
}
pub fn after_socket_creation(self) -> anyhow::Result<()> {
if self.config.drop_privileges {
if self.barrier.wait().is_leader() {
PrivDrop::default()
.chroot(self.config.chroot_path.clone())
.group(self.config.group.clone())
.user(self.config.user.clone())
.apply()
.with_context(|| "couldn't drop privileges after socket creation")?;
}
if self.config.drop_privileges && self.barrier.wait().is_leader() {
PrivDrop::default()
.chroot(self.config.chroot_path.clone())
.group(self.config.group.clone())
.user(self.config.user.clone())
.apply()
.with_context(|| "couldn't drop privileges after socket creation")?;
}
Ok(())