From a82e4e1d50dd5bb96903ae7ad4ab26b7854d90cb Mon Sep 17 00:00:00 2001 From: selfhoster1312 Date: Tue, 22 Aug 2023 19:47:20 +0200 Subject: [PATCH] Apply socket permissions after socket creation --- src/utils/socket.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/socket.rs b/src/utils/socket.rs index 49336c8..c6eb59b 100644 --- a/src/utils/socket.rs +++ b/src/utils/socket.rs @@ -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::()) .await.context(ServerSnafu)?;