diff options
| author | Chong Yidong | 2008-08-05 18:06:53 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-08-05 18:06:53 +0000 |
| commit | 495a2055a5d800bb426dc90e750f8c05db04fa34 (patch) | |
| tree | d16e45cfb31eacfd002dbfbcb1abb7550adfc434 | |
| parent | 3ae0aed3179e055db90d654d3ae71a3ed85ea4d3 (diff) | |
| download | emacs-495a2055a5d800bb426dc90e750f8c05db04fa34.tar.gz emacs-495a2055a5d800bb426dc90e750f8c05db04fa34.zip | |
(socket_connection): Add conditionals for HAVE_KRB5_ERROR_TEXT and
HAVE_KRB5_ERROR_E_TEXT to support compilation with MIT Kerberos and
Heimdal, respectively.
| -rw-r--r-- | lib-src/pop.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib-src/pop.c b/lib-src/pop.c index 7de5e17e20d..29c9712d3ec 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c | |||
| @@ -1200,11 +1200,12 @@ socket_connection (host, flags) | |||
| 1200 | krb5_free_principal (kcontext, server); | 1200 | krb5_free_principal (kcontext, server); |
| 1201 | if (rem) | 1201 | if (rem) |
| 1202 | { | 1202 | { |
| 1203 | strcpy (pop_error, KRB_ERROR); | ||
| 1204 | strncat (pop_error, error_message (rem), | ||
| 1205 | ERROR_MAX - sizeof (KRB_ERROR)); | ||
| 1206 | #if defined HAVE_KRB5_ERROR_TEXT | ||
| 1203 | if (err_ret && err_ret->text.length) | 1207 | if (err_ret && err_ret->text.length) |
| 1204 | { | 1208 | { |
| 1205 | strcpy (pop_error, KRB_ERROR); | ||
| 1206 | strncat (pop_error, error_message (rem), | ||
| 1207 | ERROR_MAX - sizeof (KRB_ERROR)); | ||
| 1208 | strncat (pop_error, " [server says '", | 1209 | strncat (pop_error, " [server says '", |
| 1209 | ERROR_MAX - strlen (pop_error) - 1); | 1210 | ERROR_MAX - strlen (pop_error) - 1); |
| 1210 | strncat (pop_error, err_ret->text.data, | 1211 | strncat (pop_error, err_ret->text.data, |
| @@ -1213,12 +1214,17 @@ socket_connection (host, flags) | |||
| 1213 | strncat (pop_error, "']", | 1214 | strncat (pop_error, "']", |
| 1214 | ERROR_MAX - strlen (pop_error) - 1); | 1215 | ERROR_MAX - strlen (pop_error) - 1); |
| 1215 | } | 1216 | } |
| 1216 | else | 1217 | #elif defined HAVE_KRB5_ERROR_E_TEXT |
| 1218 | if (err_ret && err_ret->e_text && strlen(*err_ret->e_text)) | ||
| 1217 | { | 1219 | { |
| 1218 | strcpy (pop_error, KRB_ERROR); | 1220 | strncat (pop_error, " [server says '", |
| 1219 | strncat (pop_error, error_message (rem), | 1221 | ERROR_MAX - strlen (pop_error) - 1); |
| 1220 | ERROR_MAX - sizeof (KRB_ERROR)); | 1222 | strncat (pop_error, *err_ret->e_text, |
| 1223 | ERROR_MAX - strlen (pop_error) - 1); | ||
| 1224 | strncat (pop_error, "']", | ||
| 1225 | ERROR_MAX - strlen (pop_error) - 1); | ||
| 1221 | } | 1226 | } |
| 1227 | #endif | ||
| 1222 | if (err_ret) | 1228 | if (err_ret) |
| 1223 | krb5_free_error (kcontext, err_ret); | 1229 | krb5_free_error (kcontext, err_ret); |
| 1224 | krb5_auth_con_free (kcontext, auth_context); | 1230 | krb5_auth_con_free (kcontext, auth_context); |