[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs-22.2: regression, cannot compile with heimdal but can with mit
From: |
Ulrich Mueller |
Subject: |
Re: emacs-22.2: regression, cannot compile with heimdal but can with mit-krb5 |
Date: |
Fri, 04 Apr 2008 13:03:46 +0200 |
>>>>> On Tue, 01 Apr 2008, Martin MOKREJŠ wrote:
> I would like to point you to the bug report at
> http://bugs.gentoo.org/show_bug.cgi?id=215558
> Briefly (credits to Michael Hammer (mueli)):
> Here is the definition of the krb5_error struct in mit-krb5 which
> seams compatible with emacs-22.2:
> [...]
> krb5_data text; /* descriptive text */
> krb5_data e_data; /* additional error-describing data */
> [...]
> and here is the heimdal code. You can see that the struct members
> are named differently:
> [...]
> heim_general_string *e_text;
> heim_octet_string *e_data;
> [...]
Hi,
Two alternative ways have been suggested (see Gentoo bug mentioned
above) to make Emacs compile also with Heimdal:
1. Honza Macháček has pointed out that there exists the
following patch from T2, which uses "e_data" instead of "text":
<http://svn.exactcode.de/t2/branches/7.0/package/security/heimdal/emacs-pop.diff>
2. The patch (by myself) attached to this message, which adds an
autoconf test, in order to determine if the struct contains a
"text" or "e_text" member. This compiles and links against
MIT Kerberos or against Heimdal.
Ulrich
--- emacs-22.2-orig/configure.in 2008-04-02 18:28:37.000000000 +0200
+++ emacs-22.2/configure.in 2008-04-02 22:18:38.000000000 +0200
@@ -2700,7 +2700,9 @@
fi
if test "${with_kerberos5+set}" = set; then
- AC_CHECK_HEADERS(krb5.h)
+ AC_CHECK_HEADERS(krb5.h,
+ AC_CHECK_MEMBERS([krb5_error.text, krb5_error.e_text],,,
+ [#include <krb5.h>]))
else
AC_CHECK_HEADERS(des.h,,
[AC_CHECK_HEADERS(kerberosIV/des.h,,
--- emacs-22.2-orig/lib-src/pop.c 2008-02-23 14:49:00.000000000 +0100
+++ emacs-22.2/lib-src/pop.c 2008-04-02 22:35:55.000000000 +0200
@@ -1200,11 +1200,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,
@@ -1213,12 +1214,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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: emacs-22.2: regression, cannot compile with heimdal but can with mit-krb5,
Ulrich Mueller <=