udp, http: move privilege drop code into aquatic_common

This commit is contained in:
Joakim Frostegård 2021-10-27 20:49:15 +02:00
parent ead7650d41
commit d6d5cc78b7
11 changed files with 72 additions and 87 deletions

View file

@ -1,11 +1,11 @@
use std::sync::{atomic::AtomicUsize, Arc};
use aquatic_common::access_list::AccessList;
use aquatic_common::privileges::drop_privileges_after_socket_binding;
use glommio::channels::channel_mesh::MeshBuilder;
use glommio::prelude::*;
use crate::config::Config;
use crate::drop_privileges_after_socket_binding;
mod common;
pub mod handlers;
@ -88,7 +88,7 @@ pub fn run(config: Config) -> anyhow::Result<()> {
executors.push(executor);
}
drop_privileges_after_socket_binding(&config, num_bound_sockets).unwrap();
drop_privileges_after_socket_binding(&config.privileges, num_bound_sockets, config.socket_workers).unwrap();
for executor in executors {
executor