diff options
Diffstat (limited to 'source4/kdc/kdc.c')
-rw-r--r-- | source4/kdc/kdc.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c index c58f738243..d1582215f8 100644 --- a/source4/kdc/kdc.c +++ b/source4/kdc/kdc.c @@ -38,6 +38,7 @@ #include "heimdal/kdc/windc_plugin.h" #include "heimdal/lib/krb5/krb5_locl.h" #include "heimdal/kdc/kdc_locl.h" +#include "param/param.h" /* Disgusting hack to get a mem_ctx into the hdb plugin, when used as a keytab */ @@ -50,7 +51,7 @@ struct kdc_reply { DATA_BLOB packet; }; -typedef BOOL (*kdc_process_fn_t)(struct kdc_server *kdc, +typedef bool (*kdc_process_fn_t)(struct kdc_server *kdc, TALLOC_CTX *mem_ctx, DATA_BLOB *input, DATA_BLOB *reply, @@ -310,7 +311,7 @@ static void kdc_tcp_send(struct stream_connection *conn, uint16_t flags) calling conventions */ -static BOOL kdc_process(struct kdc_server *kdc, +static bool kdc_process(struct kdc_server *kdc, TALLOC_CTX *mem_ctx, DATA_BLOB *input, DATA_BLOB *reply, @@ -336,7 +337,7 @@ static BOOL kdc_process(struct kdc_server *kdc, datagram_reply); if (ret == -1) { *reply = data_blob(NULL, 0); - return False; + return false; } if (k5_reply.length) { *reply = data_blob_talloc(mem_ctx, k5_reply.data, k5_reply.length); @@ -344,7 +345,7 @@ static BOOL kdc_process(struct kdc_server *kdc, } else { *reply = data_blob(NULL, 0); } - return True; + return true; } /* @@ -407,15 +408,14 @@ static const struct stream_server_ops kpasswdd_tcp_stream_ops = { /* start listening on the given address */ -static NTSTATUS kdc_add_socket(struct kdc_server *kdc, const char *address) +static NTSTATUS kdc_add_socket(struct kdc_server *kdc, const char *address, + uint16_t kdc_port, uint16_t kpasswd_port) { const struct model_ops *model_ops; struct kdc_socket *kdc_socket; struct kdc_socket *kpasswd_socket; struct socket_address *kdc_address, *kpasswd_address; NTSTATUS status; - uint16_t kdc_port = lp_krb5_port(); - uint16_t kpasswd_port = lp_kpasswd_port(); kdc_socket = talloc(kdc, struct kdc_socket); NT_STATUS_HAVE_NO_MEMORY(kdc_socket); @@ -526,7 +526,8 @@ static NTSTATUS kdc_startup_interfaces(struct kdc_server *kdc) for (i=0; i<num_interfaces; i++) { const char *address = talloc_strdup(tmp_ctx, iface_n_ip(i)); - status = kdc_add_socket(kdc, address); + status = kdc_add_socket(kdc, address, lp_krb5_port(global_loadparm), + lp_kpasswd_port(global_loadparm)); NT_STATUS_NOT_OK_RETURN(status); } @@ -554,7 +555,7 @@ static void kdc_task_init(struct task_server *task) NTSTATUS status; krb5_error_code ret; - switch (lp_server_role()) { + switch (lp_server_role(global_loadparm)) { case ROLE_STANDALONE: task_server_terminate(task, "kdc: no KDC required in standalone configuration"); return; |