From 2ee334a235a73c08941f65c5b8e3697757458010 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 17 Oct 2013 11:24:44 +0200 Subject: krb5_locator: Allow socktype to be 0 (any) man 3 getaddrinfo: ai_socktype This field specifies the preferred socket type, for example SOCK_STREAM or SOCK_DGRAM. Specifying 0 in this field indicatesa that socket addresses of any type can be returned by getaddrinfo(). Heimdal makes use of this and passes socktype = 0. This makes the locator plugin usable with heimdal. --- src/krb5_plugin/sssd_krb5_locator_plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/krb5_plugin/sssd_krb5_locator_plugin.c b/src/krb5_plugin/sssd_krb5_locator_plugin.c index 725687dd..586c7dd1 100644 --- a/src/krb5_plugin/sssd_krb5_locator_plugin.c +++ b/src/krb5_plugin/sssd_krb5_locator_plugin.c @@ -340,6 +340,7 @@ krb5_error_code sssd_krb5_locator_lookup(void *private_data, switch (socktype) { case SOCK_STREAM: case SOCK_DGRAM: + case 0: /* any */ break; default: return KRB5_PLUGIN_NO_HANDLE; @@ -374,7 +375,7 @@ krb5_error_code sssd_krb5_locator_lookup(void *private_data, ai->ai_family, ai->ai_socktype)); if ((family == AF_UNSPEC || ai->ai_family == family) && - ai->ai_socktype == socktype) { + (ai->ai_socktype == socktype || socktype == 0)) { ret = cbfunc(cbdata, socktype, ai->ai_addr); if (ret != 0) { -- cgit