* emacs-22.2: regression, cannot compile with heimdal but can with mit-krb5
@ 2008-04-01 20:48 Martin MOKREJŠ
0 siblings, 0 replies; 2+ messages in thread
From: Martin MOKREJŠ @ 2008-04-01 20:48 UTC (permalink / raw)
To: bug-gnu-emacs
Hi,
it seems there is an new incompatibility introduced in 22.2.
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:
typedef struct _krb5_error {
krb5_magic magic;
/* some of these may be meaningless in certain contexts */
krb5_timestamp ctime; /* client sec portion; optional */
krb5_int32 cusec; /* client usec portion; optional */
krb5_int32 susec; /* server usec portion */
krb5_timestamp stime; /* server sec portion */
krb5_ui_4 error; /* error code (protocol error #'s) */
krb5_principal client; /* client's principal identifier;
optional */
krb5_principal server; /* server's principal identifier */
krb5_data text; /* descriptive text */
krb5_data e_data; /* additional error-describing data */
} krb5_error;
and here is the heimdal code. You can see that the struct members are named
differently:
typedef struct KRB_ERROR {
krb5int32 pvno;
MESSAGE_TYPE msg_type;
KerberosTime *ctime;
krb5int32 *cusec;
KerberosTime stime;
krb5int32 susec;
krb5int32 error_code;
Realm *crealm;
PrincipalName *cname;
Realm realm;
PrincipalName sname;
heim_general_string *e_text;
heim_octet_string *e_data;
} KRB_ERROR;
You can see the difference:
krb5_data text; <-> heim_general_string *e_text;
---
text <-> e_text
Is it possible to patch pop.c that it supports both versions? I would say
that's an issue for emacs upstream - isn't it?
One more comment on this topic. I've just looked into rfc4120 (2005) (didn't
change from RFC1510 (1993) which is referred to in
http://web.mit.edu/Kerberos/papers.html#k5-protocol) and found that heimdal is
here the standard conform implementation:
KRB-ERROR ::= [APPLICATION 30] SEQUENCE {
pvno [0] INTEGER (5),
msg-type [1] INTEGER (30),
ctime [2] KerberosTime OPTIONAL,
cusec [3] Microseconds OPTIONAL,
stime [4] KerberosTime,
susec [5] Microseconds,
error-code [6] Int32,
crealm [7] Realm OPTIONAL,
cname [8] PrincipalName OPTIONAL,
realm [9] Realm -- service realm --,
sname [10] PrincipalName -- service name --,
e-text [11] KerberosString OPTIONAL,
e-data [12] OCTET STRING OPTIONAL
}
Please if possible, post an answer&fix to the bugzilla at gentoo.org as well.
Thanks,
martin
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: emacs-22.2: regression, cannot compile with heimdal but can with mit-krb5
[not found] <mailman.9829.1207117718.18990.bug-gnu-emacs@gnu.org>
@ 2008-04-04 11:03 ` Ulrich Mueller
0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Mueller @ 2008-04-04 11:03 UTC (permalink / raw)
To: emacs-devel; +Cc: bug-gnu-emacs, =?UTF-8?q?Martin MOKREJ=C5=A0?=, emacs
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
>>>>> 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
[-- Attachment #2: emacs-22.2-pop-heimdal.patch --]
[-- Type: text/plain, Size: 1906 bytes --]
--- 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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-04 11:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.9829.1207117718.18990.bug-gnu-emacs@gnu.org>
2008-04-04 11:03 ` emacs-22.2: regression, cannot compile with heimdal but can with mit-krb5 Ulrich Mueller
2008-04-01 20:48 Martin MOKREJŠ
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.