Bladeren bron

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.
Sergey Bugaev 1 jaar geleden
bovenliggende
commit
1205f29a40
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      Userland/Libraries/LibSQL/SQLClient.cpp

+ 1 - 1
Userland/Libraries/LibSQL/SQLClient.cpp

@@ -39,7 +39,7 @@ static ErrorOr<int> create_database_socket(ByteString const& socket_path)
     TRY(Core::System::fcntl(socket_fd, F_SETFD, FD_CLOEXEC));
     TRY(Core::System::fcntl(socket_fd, F_SETFD, FD_CLOEXEC));
 #    endif
 #    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));
     TRY(Core::System::fchmod(socket_fd, 0600));
 #    endif
 #    endif