Fix copying conditions.
[shishi.git] / extra / mailutils.diff
blob7a529a5d32bf107f68f57471d9a9b767c8c7845c
1 Index: ChangeLog
2 ===================================================================
3 RCS file: /cvsroot/mailutils/mailutils/ChangeLog,v
4 retrieving revision 1.744
5 diff -u -p -r1.744 ChangeLog
6 --- ChangeLog 7 Aug 2003 09:00:27 -0000 1.744
7 +++ ChangeLog 9 Aug 2003 21:14:28 -0000
8 @@ -1,3 +1,13 @@
9 +2003-06-28 Simon Josefsson <jas@extundo.com>
11 + * m4/gssapi.m4: Check for GSS. Define GSS_C_NT_HOSTBASED_SERVICE
12 + as gss_nt_service_name if it doesn't exist, for MIT Kerberos 5.
14 + * imap4d/auth_gss.c: Support GSS.
15 + (imap4d_gss_userok): Simply compare auth name with authz name.
16 + (auth_gssapi): Use the RFC standard GSS_C_NT_HOSTBASED_SERVICE
17 + instead of MIT-specific gss_nt_service_name.
19 2003-08-07 Sergey Poznyakoff
21 * NEWS: Updated
22 Index: imap4d/auth_gss.c
23 ===================================================================
24 RCS file: /cvsroot/mailutils/mailutils/imap4d/auth_gss.c,v
25 retrieving revision 1.9
26 diff -u -p -r1.9 auth_gss.c
27 --- imap4d/auth_gss.c 26 May 2003 09:57:45 -0000 1.9
28 +++ imap4d/auth_gss.c 9 Aug 2003 21:14:28 -0000
29 @@ -23,9 +23,13 @@
31 #include <netinet/in.h>
33 +#ifdef WITH_GSS
34 +#include <gss.h>
35 +#else
36 #include <krb5.h>
37 #include <gssapi/gssapi.h>
38 #include <gssapi/gssapi_generic.h>
39 +#endif
41 #define GSS_AUTH_P_NONE 1
42 #define GSS_AUTH_P_INTEGRITY 2
43 @@ -64,6 +68,10 @@ display_status (char *msg, OM_uint32 maj
44 static int
45 imap4d_gss_userok (gss_buffer_t client_name, char *name)
47 +#ifdef WITH_GSS
48 + return (strlen(name) == client_name->length &&
49 + memcmp(name, client_name->value, client_name->length) == 0) ? 0 : 1;
50 +#else
51 int rc = -1;
52 krb5_principal p;
53 krb5_context kcontext;
54 @@ -78,6 +86,7 @@ imap4d_gss_userok (gss_buffer_t client_n
55 rc = 1;
56 krb5_free_principal (kcontext, p);
57 return rc;
58 +#endif
61 static int
62 @@ -112,7 +121,7 @@ auth_gssapi (struct imap4d_command *comm
63 tokbuf.value = tmp;
64 tokbuf.length = strlen (tokbuf.value) + 1;
65 maj_stat = gss_import_name (&min_stat, &tokbuf,
66 - gss_nt_service_name, &server_name);
67 + GSS_C_NT_HOSTBASED_SERVICE, &server_name);
68 if (maj_stat != GSS_S_COMPLETE)
70 display_status ("import name", maj_stat, min_stat);
71 Index: m4/gssapi.m4
72 ===================================================================
73 RCS file: /cvsroot/mailutils/mailutils/m4/gssapi.m4,v
74 retrieving revision 1.5
75 diff -u -p -r1.5 gssapi.m4
76 --- m4/gssapi.m4 13 Jan 2003 15:07:20 -0000 1.5
77 +++ m4/gssapi.m4 9 Aug 2003 21:14:28 -0000
78 @@ -4,7 +4,9 @@ dnl MU_CHECK_GSSAPI(PREFIX)
79 dnl Search for a GSSAPI implementation in the standard locations plus PREFIX,
80 dnl if it is set and not "yes".
81 dnl Defines GSSAPI_CFLAGS and GSSAPI_LIBS if found.
82 -dnl Defines GSSAPI_IMPL to "Heimdal", "MIT", or "OldMIT", or "none" if not found
83 +dnl Defines GSSAPI_IMPL to "GSS", "Heimdal", "MIT", or "OldMIT", or
84 +dnl "none" if not found
86 AC_DEFUN(MU_CHECK_GSSAPI,
88 if test "x$mu_cv_lib_gssapi_libs" = x; then
89 @@ -18,7 +20,25 @@ AC_DEFUN(MU_CHECK_GSSAPI,
90 krb5_path="$PATH"
92 AC_PATH_PROG(KRB5CFGPATH, krb5-config, none, $krb5_path)
93 - if test "$KRB5CFGPATH" != "none"; then
94 + AC_CHECK_HEADER(gss.h, [wantgss=yes], [wantgss=no])
95 + if test $wantgss != no; then
96 + save_LIBS=$LIBS
97 + AC_CHECK_LIB(gss, gss_check_version, [GSSAPI_LIBS=-lgss], [wantgss=no])
98 + if test $wantgss != no; then
99 + LIBS="$LIBS $GSSAPI_LIBS"
100 + AC_TRY_RUN([
101 +#include <gss.h>
102 +int main() { return gss_check_version ("0.0.2") == (char*) 0; }],
103 + [:],
104 + [wantgss=no],
105 + [wantgss=no])
106 + fi
107 + LIBS=$save_LIBS
108 + fi
109 + if test $wantgss != no; then
110 + GSSAPI_IMPL="GSS"
111 + AC_DEFINE(WITH_GSS,1,[Define if mailutils is using GSS library for GSSAPI])
112 + elif test "$KRB5CFGPATH" != "none"; then
113 GSSAPI_CFLAGS="$CPPFLAGS `$KRB5CFGPATH --cflags gssapi`"
114 GSSAPI_LIBS="`$KRB5CFGPATH --libs gssapi`"
115 GSSAPI_IMPL="Heimdal"
116 @@ -62,6 +82,13 @@ AC_DEFUN(MU_CHECK_GSSAPI,
117 ,, -lkrb5 -lcrypto -lcom_err)
120 + AC_CHECK_DECL(GSS_C_NT_HOSTBASED_SERVICE,,
121 + [AC_DEFINE(GSS_C_NT_HOSTBASED_SERVICE,
122 + gss_nt_service_name,
123 + [Work around buggy MIT library])],[
124 +#include <gssapi/gssapi.h>
125 +#include <gssapi/gssapi_generic.h>
127 CPPFLAGS="$saved_CPPFLAGS"
128 LDFLAGS="$saved_LDFLAGS"
129 LIBS="$saved_LIBS"