moby / vpnkit

A toolkit for embedding VPN capabilities in your application
Apache License 2.0
1.1k stars 187 forks source link

transport: fix off-by-one in the max socket path #507

Closed djs55 closed 4 years ago

djs55 commented 4 years ago

On Mac the max socket length is 104 which includes a NULL on the end. A Go path of length 104 will fail. The effective max length is 103.

This patch includes a test case which checks that, when the bind fails, the length is > maxUnixSocketPathLen.

Signed-off-by: <David Scott dave.scott@docker.com>

thaJeztah commented 4 years ago

Do we need a "lol 104 chars ETOOMANY"? https://github.com/moby/moby/pull/13408

djs55 commented 4 years ago

@thaJeztah hah yes, just when you thought 108 chars was bad, now we have 104!

@guillaumerose thanks!