Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jul 27, 2020

Conversation

djs55
Copy link
Collaborator

@djs55 djs55 commented Jul 24, 2020

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>

Signed-off-by: David Scott <dave.scott@docker.com>
Signed-off-by: David Scott <dave.scott@docker.com>
Signed-off-by: David Scott <dave.scott@docker.com>
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>
Signed-off-by: David Scott <dave.scott@docker.com>
@thaJeztah
Copy link
Member

Do we need a "lol 104 chars ETOOMANY"? moby/moby#13408

@djs55
Copy link
Collaborator Author

djs55 commented Jul 27, 2020

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

@guillaumerose thanks!

@djs55 djs55 merged commit 5536024 into moby:master Jul 27, 2020
@djs55 djs55 deleted the fix-off-by-one branch July 27, 2020 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants