1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Max length of UNIX socket path is 104 bytes on macOS

This commit is contained in:
Nobuyoshi Nakada 2019-06-23 23:12:47 +09:00
parent 50b2807a7c
commit 97a7f463f6
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -34,9 +34,9 @@ module SocketSpecs
def self.socket_path
path = tmp("unix.sock", false)
# Check for too long unix socket path (max 108 bytes including \0 => 107)
# Check for too long unix socket path (max 104 bytes on macOS)
# Note that Linux accepts not null-terminated paths but the man page advises against it.
if path.bytesize > 107
if path.bytesize > 104
path = "/tmp/unix_server_spec.socket"
end
rm_socket(path)