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

Fixed #623: getaddrinfo calls with a service name fail on Docker images that lack /etc/services. #631

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Unix/http/httpclientauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2562,7 +2562,9 @@ static char *_BuildInitialGssAuthHeader(_In_ HttpClient_SR_SocketData * self, MI
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;

if ((gai_result = getaddrinfo(self->hostname, "http", &hints, &info)) != 0)
// Use a port number rather than a service name (http), which relies on /etc/services, which may not be available.
// The port number is irrelevant anyway since we're only using info->ai_canonname below.
if ((gai_result = getaddrinfo(self->hostname, "80", &hints, &info)) != 0)
{
trace_HTTP_GetAddrInfoError(gai_strerror(gai_result));
return NULL;
Expand Down