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.
This commit is contained in:
Sergey Bugaev 2024-01-14 17:39:28 +03:00 committed by Andrew Kaster
parent c64c199ab7
commit 1205f29a40
Notes: sideshowbarker 2024-07-17 03:27:40 +09:00

View file

@ -39,7 +39,7 @@ static ErrorOr<int> 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