1.\" Copyright (c) 2004 Kungliga Tekniska Högskolan 2.\" (Royal Institute of Technology, Stockholm, Sweden). 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 16.\" 3. Neither the name of the Institute nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" $Id$ 33.\" 34.Dd July 26, 2004 35.Dt KRB5_RD_ERROR 3 36.Os HEIMDAL 37.Sh NAME 38.Nm krb5_rd_error , 39.Nm krb5_free_error , 40.Nm krb5_free_error_contents , 41.Nm krb5_error_from_rd_error 42.Nd parse, free and read error from KRB-ERROR message 43.Sh LIBRARY 44Kerberos 5 Library (libkrb5, -lkrb5) 45.Sh SYNOPSIS 46.In krb5.h 47.Ft krb5_error_code 48.Fo krb5_rd_error 49.Fa "krb5_context context" 50.Fa "const krb5_data *msg" 51.Fa "KRB_ERROR *result" 52.Fc 53.Ft void 54.Fo krb5_free_error 55.Fa "krb5_context context" 56.Fa "krb5_error *error" 57.Fc 58.Ft void 59.Fo krb5_free_error_contents 60.Fa "krb5_context context" 61.Fa "krb5_error *error" 62.Fc 63.Ft krb5_error_code 64.Fo krb5_error_from_rd_error 65.Fa "krb5_context context" 66.Fa "const krb5_error *error" 67.Fa "const krb5_creds *creds" 68.Fc 69.Sh DESCRIPTION 70Usually applications never needs to parse and understand Kerberos 71error messages since higher level functions will parse and push up the 72error in the krb5_context. 73These functions are described for completeness. 74.Pp 75.Fn krb5_rd_error 76parses and returns the kerboeros error message, the structure should be freed with 77.Fn krb5_free_error_contents 78when the caller is done with the structure. 79.Pp 80.Fn krb5_free_error 81frees the content and the memory region holding the structure iself. 82.Pp 83.Fn krb5_free_error_contents 84free the content of the KRB-ERROR message. 85.Pp 86.Fn krb5_error_from_rd_error 87will parse the error message and set the error buffer in krb5_context 88to the error string passed back or the matching error code in the 89KRB-ERROR message. 90Caller should pick up the message with 91.Fn krb5_get_error_string 3 92(don't forget to free the returned string with 93.Fn krb5_free_error_string ) . 94.Sh SEE ALSO 95.Xr krb5 3 , 96.Xr krb5_set_error_string 3 , 97.Xr krb5_get_error_string 3 , 98.Xr krb5.conf 5 99