From 718cc24648085eb30105aae54870efdc3fb380ca Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sun, 13 Aug 2023 14:28:17 +0900 Subject: [PATCH] Fix erronous socket filename --- src/client.c | 2 +- src/socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.c b/src/client.c index 43b80b1..9979ce4 100644 --- a/src/client.c +++ b/src/client.c @@ -53,7 +53,7 @@ int main(int argc, char **argv) { char socket_filename[108]; snprintf(socket_filename, sizeof(socket_filename), - UNIX_SOCKET_HANDLER_SOCKET_FMT_STRING, getenv("HOME")); + UNIX_SOCKET_HANDLER_SOCKET_FMT_STRING, getenv("USER")); struct sockaddr_un addr; int ret; diff --git a/src/socket.c b/src/socket.c index 43a5f0a..a1c2c95 100644 --- a/src/socket.c +++ b/src/socket.c @@ -115,7 +115,7 @@ void init_unix_socket_handler(UnixSocketHandler *handler) { memset(handler, 0, sizeof(UnixSocketHandler)); snprintf(handler->socket_filename, sizeof(handler->socket_filename), - UNIX_SOCKET_HANDLER_SOCKET_FMT_STRING, getenv("HOME")); + UNIX_SOCKET_HANDLER_SOCKET_FMT_STRING, getenv("USER")); umask(S_IRWXO);