feat: group should have write permission on the socket file
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user