feat: group should have write permission on the socket file

This commit is contained in:
2026-04-01 06:33:34 +02:00
parent 6e81197419
commit a50b65ae0c

View File

@@ -75,7 +75,15 @@ fn serve(config: &Config) {
INFO!("Use unix domain socket: {}", socket_name);
std::env::set_var("socket", socket_name);
clean_up(0);
let listener = UnixListener::bind(socket_name.replace("unix:", "")).unwrap();
let path = socket_name.replace("unix:", "");
let listener = UnixListener::bind(&path).unwrap();
INFO!("Allow writeable for group on {}", path);
if let Err(error) =
nix::sys::stat::fchmod(listener.as_raw_fd(), nix::sys::stat::Mode::S_IWGRP)
{
ERROR!("Unable to allow writable for group on {}: {}", path, error);
}
for client in listener.incoming() {
let mut stream = client.unwrap();
pool.execute(move || handle_request(&mut stream));