In addition to setting the kpasswd port after
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 18 Jan 2007 15:28:07 +0000 (15:28 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 18 Jan 2007 15:28:07 +0000 (15:28 +0000)
searching for kadmind host addresses we must also
set the socket type according to the request.

ticket: 5393
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19070 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/changepw.c

index 60f2d1d64a78da7b44775083b4342b32f7980a66..a2bf8f0b38f32dc286185a87ff6f883ffbcef501 100644 (file)
@@ -70,12 +70,14 @@ krb5_locate_kpasswd(krb5_context context, const krb5_data *realm,
                                      locate_service_kadmin, SOCK_STREAM, 0);
        if (!code) {
            /* Success with admin_server but now we need to change the
-              port number to use DEFAULT_KPASSWD_PORT.  */
+              port number to use DEFAULT_KPASSWD_PORT and the socktype.  */
            int i;
            for (i=0; i<addrlist->naddrs; i++) {
                struct addrinfo *a = addrlist->addrs[i].ai;
                if (a->ai_family == AF_INET)
                    sa2sin (a->ai_addr)->sin_port = htons(DEFAULT_KPASSWD_PORT);
+               if (sockType != SOCK_STREAM)
+                   a->ai_socktype = sockType;
            }
        }
     }