s3:libads: let get_kdc_ip_string() also return kpasswd_server entries for each kdc
authorStefan Metzmacher <metze@samba.org>
Thu, 9 Feb 2017 06:57:51 +0000 (07:57 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Feb 2019 12:38:24 +0000 (13:38 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12515

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/libads/kerberos.c

index c5eb2920d6d284a2108874ee7186b5024e039d8e..5846b97f6baea0b22d1ec2791e79401fb90aa641 100644 (file)
@@ -376,6 +376,7 @@ static char *get_kdc_ip_string(char *mem_ctx,
        NTSTATUS status;
        char *addr_str = NULL;
        const uint16_t kdc_port = 88;
+       const uint16_t kpasswd_port = 464;
 
        addr_str = print_canonical_sockaddr(talloc_tos(), pss);
        if (addr_str == NULL) {
@@ -389,8 +390,10 @@ static char *get_kdc_ip_string(char *mem_ctx,
         * the hard-coded portnumber workarounds the issue. - gd
         */
        result = talloc_asprintf(mem_ctx,
-                                "\t\tkdc = %s:%u\n",
-                                addr_str, kdc_port);
+                                "\t\tkdc = %s:%u\n"
+                                "\t\tkpasswd_server = %s:%u\n",
+                                addr_str, kdc_port,
+                                addr_str, kpasswd_port);
        TALLOC_FREE(addr_str);
        if (result == NULL) {
                goto out;
@@ -498,8 +501,10 @@ static char *get_kdc_ip_string(char *mem_ctx,
 
                /* Append to the string - inefficient but not done often. */
                new_str = talloc_asprintf_append_buffer(result,
-                                       "\t\tkdc = %s:%u\n",
-                                       addr_str, kdc_port);
+                                       "\t\tkdc = %s:%u\n"
+                                       "\t\tkpasswd_server = %s:%u\n",
+                                       addr_str, kdc_port,
+                                       addr_str, kpasswd_port);
                TALLOC_FREE(addr_str);
                if (new_str == NULL) {
                        goto out;