Avoid including libds/common/roles.h in public loadparm.h header.
[obnox/samba/samba-obnox.git] / source4 / kdc / kdc.c
index a8939069aa4a1a5e17767ab117ed9ec8e93d8d86..4a9341fcb35fb0eee36bae6a1789d7e1d4715f13 100644 (file)
@@ -35,6 +35,7 @@
 #include "kdc/pac-glue.h"
 #include "dsdb/samdb/samdb.h"
 #include "auth/session.h"
+#include "libds/common/roles.h"
 
 NTSTATUS server_service_kdc_init(void);
 
@@ -617,10 +618,9 @@ static void kdc_udp_call_sendto_done(struct tevent_req *subreq)
 {
        struct kdc_udp_call *call = tevent_req_callback_data(subreq,
                                       struct kdc_udp_call);
-       ssize_t ret;
        int sys_errno;
 
-       ret = tdgram_sendto_queue_recv(subreq, &sys_errno);
+       tdgram_sendto_queue_recv(subreq, &sys_errno);
 
        /* We don't care about errors */
 
@@ -734,24 +734,32 @@ static NTSTATUS kdc_startup_interfaces(struct kdc_server *kdc, struct loadparm_c
        /* if we are allowing incoming packets from any address, then
           we need to bind to the wildcard address */
        if (!lpcfg_bind_interfaces_only(lp_ctx)) {
-               const char **wcard = iface_list_wildcard(kdc, lp_ctx);
+               int num_binds = 0;
+               char **wcard = iface_list_wildcard(kdc);
                NT_STATUS_HAVE_NO_MEMORY(wcard);
                for (i=0; wcard[i]; i++) {
                        if (kdc_port) {
                                status = kdc_add_socket(kdc, model_ops,
                                                        "kdc", wcard[i], kdc_port,
                                                        kdc_process, false);
-                               NT_STATUS_NOT_OK_RETURN(status);
+                               if (NT_STATUS_IS_OK(status)) {
+                                       num_binds++;
+                               }
                        }
 
                        if (kpasswd_port) {
                                status = kdc_add_socket(kdc, model_ops,
                                                        "kpasswd", wcard[i], kpasswd_port,
                                                        kpasswdd_process, false);
-                               NT_STATUS_NOT_OK_RETURN(status);
+                               if (NT_STATUS_IS_OK(status)) {
+                                       num_binds++;
+                               }
                        }
                }
                talloc_free(wcard);
+               if (num_binds == 0) {
+                       return NT_STATUS_INVALID_PARAMETER_MIX;
+               }
                done_wildcard = true;
        }
 
@@ -919,7 +927,7 @@ static void kdc_task_init(struct task_server *task)
 
        initialize_krb5_error_table();
 
-       ret = smb_krb5_init_context(kdc, task->event_ctx, task->lp_ctx, &kdc->smb_krb5_context);
+       ret = smb_krb5_init_context(kdc, task->lp_ctx, &kdc->smb_krb5_context);
        if (ret) {
                DEBUG(1,("kdc_task_init: krb5_init_context failed (%s)\n",
                         error_message(ret)));