From ab116e4af80c1112c2f21b61f796f0b77dc38822 Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 5 Jul 2026 16:16:47 -0300 Subject: [PATCH] localsocket: properly copy bindpath to new sockets from accept() --- kernel-src/io/net/localsocket.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel-src/io/net/localsocket.c b/kernel-src/io/net/localsocket.c index 8b90b6ed..6ed1ce9f 100644 --- a/kernel-src/io/net/localsocket.c +++ b/kernel-src/io/net/localsocket.c @@ -690,6 +690,15 @@ static int localsock_accept(socket_t *_server, socket_t *_clientconnection, sock MUTEX_ACQUIRE(&binding->mutex); } + if (server->bindpath) { + size_t length = strlen(server->bindpath) + 1; + clientconnection->bindpath = alloc(length); + if (clientconnection->bindpath == NULL) + goto leave; + + memcpy(clientconnection->bindpath, server->bindpath, length); + } + // we have a valid pair and we have acquired the mutex already // configure the client connection. we don't lock it because it should only be // curretly accessible here anyways