summaryrefslogtreecommitdiff
path: root/lib-src/pop.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-08-05 23:44:48 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-08-05 23:44:48 +0000
commit5fe92a72fcd2b13ff6e40ced7afbb151a1a00ed8 (patch)
treec213ded16d9027401fadd8fd130d9f16123467b3 /lib-src/pop.c
parent39b8bb9b73f53dcb2ba3498a1d01edb35a378f89 (diff)
downloademacs-5fe92a72fcd2b13ff6e40ced7afbb151a1a00ed8.tar.gz
(socket_connection): Add conditionals for HAVE_KRB5_ERROR_TEXT and
HAVE_KRB5_ERROR_E_TEXT to support compilation with MIT Kerberos and Heimdal, respectively.
Diffstat (limited to 'lib-src/pop.c')
-rw-r--r--lib-src/pop.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 76cd2fb5792..ffc7879b863 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -1254,11 +1254,12 @@ socket_connection (host, flags)
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 @@ socket_connection (host, flags)
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);