From 1205f29a40ffe67e757c16a31a5116be35dad52f Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sun, 14 Jan 2024 17:39:28 +0300 Subject: [PATCH] LibSQL: Don't try to fchmod() socket on GNU/Hurd Because of the way sockets are implemented, a local socket object inside pflocal has little to do with the filesystem node that has an ifsock translator sitting on it; and the latter doesn't even exist until you bind() the socket. So it's not possible to set the socket's mode using Unix-level APIs (other than by temporarily changing umask). It's still possible to do this with Mach-level APIs, essentially doing the same thing as glibc's bind() implementation does, but supplying the desired mode instead of 0666, but let's not go there. --- Userland/Libraries/LibSQL/SQLClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibSQL/SQLClient.cpp b/Userland/Libraries/LibSQL/SQLClient.cpp index e37605ab912..93d4037dfe2 100644 --- a/Userland/Libraries/LibSQL/SQLClient.cpp +++ b/Userland/Libraries/LibSQL/SQLClient.cpp @@ -39,7 +39,7 @@ static ErrorOr create_database_socket(ByteString const& socket_path) TRY(Core::System::fcntl(socket_fd, F_SETFD, FD_CLOEXEC)); # endif -# if !defined(AK_OS_BSD_GENERIC) +# if !defined(AK_OS_BSD_GENERIC) && !defined(AK_OS_GNU_HURD) TRY(Core::System::fchmod(socket_fd, 0600)); # endif