Apply socket permissions after socket creation

This commit is contained in:
selfhoster selfhoster 2023-08-22 19:47:20 +02:00
parent c73f132421
commit a82e4e1d50

View File

@ -121,12 +121,13 @@ pub async fn serve(path: &Path, app: Router) -> Result<(), Error> {
.await
.unwrap();
let uds = UnixListener::bind(path.clone())
.context(SocketCreateSnafu { path: path.clone() })?;
// TODO: make proper permissions
// Apply 777 permissions
FSPermissions::new().chmod(0o777).apply_to(&path).await?;
let uds = UnixListener::bind(path.clone())
.context(SocketCreateSnafu { path: path.clone() })?;
hyper::Server::builder(ServerAccept::new(uds))
.serve(app.into_make_service_with_connect_info::<UdsConnectInfo>())
.await.context(ServerSnafu)?;