diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-02-09 09:06:20 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-03-04 21:19:05 +0100 |
commit | ad9ac99afd04b1f69ca188eb0005a1226520bc7d (patch) | |
tree | e96055996848bab8c310aad40bac16236c1d5cec /source4/kdc | |
parent | 0c78640e674914d3ee7e8233813ee91a44f16440 (diff) | |
download | samba-ad9ac99afd04b1f69ca188eb0005a1226520bc7d.tar.gz samba-ad9ac99afd04b1f69ca188eb0005a1226520bc7d.tar.bz2 samba-ad9ac99afd04b1f69ca188eb0005a1226520bc7d.zip |
s4:kdc: add a kdc_proxy_unavailable_error() helper function
metze
Diffstat (limited to 'source4/kdc')
-rw-r--r-- | source4/kdc/kdc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c index c5beaba1a3..249004323c 100644 --- a/source4/kdc/kdc.c +++ b/source4/kdc/kdc.c @@ -38,6 +38,30 @@ extern struct krb5plugin_windc_ftable windc_plugin_table; extern struct hdb_method hdb_samba4; +static NTSTATUS kdc_proxy_unavailable_error(struct kdc_server *kdc, + TALLOC_CTX *mem_ctx, + DATA_BLOB *out) +{ + int kret; + krb5_data k5_error_blob; + + kret = krb5_mk_error(kdc->smb_krb5_context->krb5_context, + KRB5KDC_ERR_SVC_UNAVAILABLE, NULL, NULL, + NULL, NULL, NULL, NULL, &k5_error_blob); + if (kret != 0) { + DEBUG(2,(__location__ ": Unable to form krb5 error reply\n")); + return NT_STATUS_INTERNAL_ERROR; + } + + *out = data_blob_talloc(mem_ctx, k5_error_blob.data, k5_error_blob.length); + krb5_data_free(&k5_error_blob); + if (!out->data) { + return NT_STATUS_NO_MEMORY; + } + + return NT_STATUS_OK; +} + static void kdc_tcp_terminate_connection(struct kdc_tcp_connection *kdcconn, const char *reason) { stream_terminate_connection(kdcconn->conn, reason); |