# HG changeset patch # User Chong Yidong # Date 1217979888 0 # Node ID 9e7bd13d8b0586986bb62f4bce899bb2b6edf216 # Parent 8c9c41a63454f28b700cc3ef97976d59c6a3450f (socket_connection): Add conditionals for HAVE_KRB5_ERROR_TEXT and HAVE_KRB5_ERROR_E_TEXT to support compilation with MIT Kerberos and Heimdal, respectively. diff -r 8c9c41a63454 -r 9e7bd13d8b05 lib-src/pop.c --- a/lib-src/pop.c Tue Aug 05 23:44:39 2008 +0000 +++ b/lib-src/pop.c Tue Aug 05 23:44:48 2008 +0000 @@ -1254,11 +1254,12 @@ krb5_free_principal (kcontext, server); if (rem) { + strcpy (pop_error, KRB_ERROR); + strncat (pop_error, error_message (rem), + ERROR_MAX - sizeof (KRB_ERROR)); +#if defined HAVE_KRB5_ERROR_TEXT if (err_ret && err_ret->text.length) { - strcpy (pop_error, KRB_ERROR); - strncat (pop_error, error_message (rem), - ERROR_MAX - sizeof (KRB_ERROR)); strncat (pop_error, " [server says '", ERROR_MAX - strlen (pop_error) - 1); strncat (pop_error, err_ret->text.data, @@ -1267,12 +1268,17 @@ strncat (pop_error, "']", ERROR_MAX - strlen (pop_error) - 1); } - else +#elif defined HAVE_KRB5_ERROR_E_TEXT + if (err_ret && err_ret->e_text && strlen(*err_ret->e_text)) { - strcpy (pop_error, KRB_ERROR); - strncat (pop_error, error_message (rem), - ERROR_MAX - sizeof (KRB_ERROR)); + strncat (pop_error, " [server says '", + ERROR_MAX - strlen (pop_error) - 1); + strncat (pop_error, *err_ret->e_text, + ERROR_MAX - strlen (pop_error) - 1); + strncat (pop_error, "']", + ERROR_MAX - strlen (pop_error) - 1); } +#endif if (err_ret) krb5_free_error (kcontext, err_ret); krb5_auth_con_free (kcontext, auth_context);