[evolution-mapi/f17] Add patch for Red Hat bug #834798 (Kerberos authentication doesn't work)

Milan Crha mcrha at fedoraproject.org
Fri Jun 29 09:28:02 UTC 2012


commit 9de049c66eba6354f823bc87eba3c1241933bf3a
Author: Milan Crha <mcrha at redhat.com>
Date:   Fri Jun 29 11:27:53 2012 +0200

    Add patch for Red Hat bug #834798 (Kerberos authentication doesn't work)

 evolution-mapi-3.4.3-krbauth.patch |  258 ++++++++++++++++++++++++++++++++++++
 evolution-mapi.spec                |    7 +-
 2 files changed, 264 insertions(+), 1 deletions(-)
---
diff --git a/evolution-mapi-3.4.3-krbauth.patch b/evolution-mapi-3.4.3-krbauth.patch
new file mode 100644
index 0000000..9be60cf
--- /dev/null
+++ b/evolution-mapi-3.4.3-krbauth.patch
@@ -0,0 +1,258 @@
+diff --git a/po/POTFILES.in b/po/POTFILES.in
+index c44f2ec..00ad501 100644
+--- a/po/POTFILES.in
++++ b/po/POTFILES.in
+@@ -11,6 +11,7 @@ src/addressbook/e-book-backend-mapi-gal.c
+ src/calendar/e-cal-backend-mapi.c
+ src/camel/camel-mapi-folder.c
+ src/camel/camel-mapi-provider.c
++src/camel/camel-mapi-sasl-krb.c
+ src/camel/camel-mapi-store.c
+ src/camel/camel-mapi-transport.c
+ src/libexchangemapi/e-mapi-cal-utils.c
+diff --git a/src/camel/Makefile.am b/src/camel/Makefile.am
+index ce4cc97..8a76c68 100644
+--- a/src/camel/Makefile.am
++++ b/src/camel/Makefile.am
+@@ -17,6 +17,7 @@ libcamelmapi_la_SOURCES = 			\
+ 	camel-mapi-provider.c			\
+ 	camel-mapi-folder.c                	\
+ 	camel-mapi-folder-summary.c		\
++	camel-mapi-sasl-krb.c			\
+         camel-mapi-store.c	                \
+ 	camel-mapi-store-summary.c         	\
+ 	camel-mapi-transport.c			
+@@ -24,6 +25,7 @@ libcamelmapi_la_SOURCES = 			\
+ noinst_HEADERS =         			\
+ 	camel-mapi-folder.h			\
+ 	camel-mapi-folder-summary.h		\
++	camel-mapi-sasl-krb.h			\
+ 	camel-mapi-store.h			\
+ 	camel-mapi-store-summary.h         	\
+ 	camel-mapi-transport.h
+diff --git a/src/camel/camel-mapi-provider.c b/src/camel/camel-mapi-provider.c
+index e0a399f..84b2737 100644
+--- a/src/camel/camel-mapi-provider.c
++++ b/src/camel/camel-mapi-provider.c
+@@ -31,6 +31,7 @@
+ 
+ #include <gmodule.h>
+ 
++#include "camel-mapi-sasl-krb.h"
+ #include "camel-mapi-store.h"
+ #include "camel-mapi-transport.h"
+ 
+@@ -114,6 +115,9 @@ camel_provider_module_init(void)
+ 	bindtextdomain (GETTEXT_PACKAGE, EXCHANGE_MAPI_LOCALEDIR);
+ 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ 
++	/* register MAPIKRB auth type */
++	CAMEL_TYPE_MAPI_SASL_KRB;
++
+ 	camel_provider_register (&mapi_provider);
+ }
+ 
+diff --git a/src/camel/camel-mapi-sasl-krb.c b/src/camel/camel-mapi-sasl-krb.c
+new file mode 100644
+index 0000000..317cf97
+--- /dev/null
++++ b/src/camel/camel-mapi-sasl-krb.c
+@@ -0,0 +1,60 @@
++/*
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) version 3.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with the program; if not, see <http://www.gnu.org/licenses/>
++ *
++ */
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#include <string.h>
++
++#include "camel-mapi-sasl-krb.h"
++
++static CamelServiceAuthType mapi_sasl_krb_auth_type = {
++	"Kerberos",
++
++	"This option will connect to the server using kerberos key.",
++
++	"MAPIKRB",
++	FALSE
++};
++
++G_DEFINE_TYPE (CamelMapiSaslKrb, camel_mapi_sasl_krb, CAMEL_TYPE_SASL)
++
++static GByteArray *
++mapi_sasl_krb_challenge_sync (CamelSasl *sasl,
++                              GByteArray *token,
++                              GCancellable *cancellable,
++                              GError **error)
++{
++	camel_sasl_set_authenticated (sasl, TRUE);
++
++	return NULL;
++}
++
++static void
++camel_mapi_sasl_krb_class_init (CamelMapiSaslKrbClass *class)
++{
++	CamelSaslClass *sasl_class;
++
++	sasl_class = CAMEL_SASL_CLASS (class);
++	sasl_class->auth_type = &mapi_sasl_krb_auth_type;
++	sasl_class->challenge_sync = mapi_sasl_krb_challenge_sync;
++}
++
++static void
++camel_mapi_sasl_krb_init (CamelMapiSaslKrb *mapi_sasl_krb)
++{
++}
+diff --git a/src/camel/camel-mapi-sasl-krb.h b/src/camel/camel-mapi-sasl-krb.h
+new file mode 100644
+index 0000000..9438592
+--- /dev/null
++++ b/src/camel/camel-mapi-sasl-krb.h
+@@ -0,0 +1,59 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
++/*
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) version 3.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with the program; if not, see <http://www.gnu.org/licenses/>
++ *
++ */
++
++#ifndef CAMEL_MAPI_SASL_KRB_H
++#define CAMEL_MAPI_SASL_KRB_H
++
++#include <camel/camel.h>
++
++/* Standard GObject macros */
++#define CAMEL_TYPE_MAPI_SASL_KRB \
++	(camel_mapi_sasl_krb_get_type ())
++#define CAMEL_MAPI_SASL_KRB(obj) \
++	(G_TYPE_CHECK_INSTANCE_CAST \
++	((obj), CAMEL_TYPE_MAPI_SASL_KRB, CamelMapiSaslKrb))
++#define CAMEL_MAPI_SASL_KRB_CLASS(cls) \
++	(G_TYPE_CHECK_CLASS_CAST \
++	((cls), CAMEL_TYPE_MAPI_SASL_KRB, CamelMapiSaslKrbClass))
++#define CAMEL_IS_MAPI_SASL_KRB(obj) \
++	(G_TYPE_CHECK_INSTANCE_TYPE \
++	((obj), CAMEL_TYPE_MAPI_SASL_KRB))
++#define CAMEL_IS_MAPI_SASL_KRB_CLASS(cls) \
++	(G_TYPE_CHECK_CLASS_TYPE \
++	((cls), CAMEL_TYPE_MAPI_SASL_KRB))
++#define CAMEL_MAPI_SASL_KRB_GET_CLASS(obj) \
++	(G_TYPE_INSTANCE_GET_CLASS \
++	((obj), CAMEL_TYPE_MAPI_SASL_KRB, CamelMapiSaslKrbClass))
++
++G_BEGIN_DECLS
++
++typedef struct _CamelMapiSaslKrb CamelMapiSaslKrb;
++typedef struct _CamelMapiSaslKrbClass CamelMapiSaslKrbClass;
++
++struct _CamelMapiSaslKrb {
++	CamelSasl parent;
++};
++
++struct _CamelMapiSaslKrbClass {
++	CamelSaslClass parent_class;
++};
++
++GType camel_mapi_sasl_krb_get_type (void);
++
++G_END_DECLS
++
++#endif /* CAMEL_MAPI_SASL_KRB_H */
+diff --git a/src/camel/camel-mapi-store.c b/src/camel/camel-mapi-store.c
+index ac781a3..13864e7 100644
+--- a/src/camel/camel-mapi-store.c
++++ b/src/camel/camel-mapi-store.c
+@@ -41,6 +41,7 @@
+ 
+ #include "camel-mapi-store.h"
+ #include "camel-mapi-folder.h"
++#include "camel-mapi-sasl-krb.h"
+ #include "camel-mapi-settings.h"
+ #include "camel-mapi-store-summary.h"
+ #include "camel-mapi-folder-summary.h"
+@@ -1972,6 +1973,9 @@ camel_mapi_store_class_init (CamelMapiStoreClass *class)
+ 	CamelServiceClass *service_class;
+ 	CamelStoreClass *store_class;
+ 
++	/* register MAPIKRB auth type */
++	CAMEL_TYPE_MAPI_SASL_KRB;
++
+ 	g_type_class_add_private (class, sizeof (CamelMapiStorePrivate));
+ 
+ 	object_class = G_OBJECT_CLASS (class);
+@@ -2101,6 +2105,7 @@ mapi_connect_sync (CamelService *service,
+ 	CamelMapiStore *store = CAMEL_MAPI_STORE (service);
+ 	CamelServiceConnectionStatus status;
+ 	CamelSession *session;
++	EMapiProfileData empd = { 0 };
+ 	uint64_t current_size = -1, receive_quota = -1, send_quota = -1;
+ 	gchar *name;
+ 
+@@ -2127,7 +2132,9 @@ mapi_connect_sync (CamelService *service,
+ 	name = camel_service_get_name (service, TRUE);
+ 	camel_operation_push_message (cancellable, _("Connecting to '%s'"), name);
+ 
+-	if (!camel_session_authenticate_sync (session, service, NULL, cancellable, error)) {
++	e_mapi_util_profiledata_from_settings (&empd, CAMEL_MAPI_SETTINGS (camel_service_get_settings (service)));
++
++	if (!camel_session_authenticate_sync (session, service, empd.krb_sso ? "MAPIKRB" : NULL, cancellable, error)) {
+ 		camel_operation_pop_message (cancellable);
+ 		camel_service_unlock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
+ 		camel_service_disconnect_sync (service, TRUE, NULL);
+@@ -2559,20 +2566,20 @@ mapi_authenticate_sync (CamelService *service,
+ 	profile = camel_mapi_settings_get_profile (mapi_settings);
+ 
+ 	if (empd.krb_sso) {
+-		if (e_mapi_util_trigger_krb_auth (&empd, error))
+-			return CAMEL_AUTHENTICATION_ACCEPTED;
+-		else
++		if (!e_mapi_util_trigger_krb_auth (&empd, error))
+ 			return CAMEL_AUTHENTICATION_ERROR;
+-	}
+ 
+-	password = camel_service_get_password (service);
++		password = NULL;
++	} else {
++		password = camel_service_get_password (service);
+ 
+-	if (password == NULL) {
+-		g_set_error_literal (
+-			error, CAMEL_SERVICE_ERROR,
+-			CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
+-			_("Authentication password not available"));
+-		return CAMEL_AUTHENTICATION_ERROR;
++		if (password == NULL) {
++			g_set_error_literal (
++				error, CAMEL_SERVICE_ERROR,
++				CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
++				_("Authentication password not available"));
++			return CAMEL_AUTHENTICATION_ERROR;
++		}
+ 	}
+ 
+ 	store->priv->conn = e_mapi_connection_new (profile, password, cancellable, &mapi_error);
diff --git a/evolution-mapi.spec b/evolution-mapi.spec
index 4d27fbb..2eda8b3 100644
--- a/evolution-mapi.spec
+++ b/evolution-mapi.spec
@@ -9,7 +9,7 @@
 
 Name: evolution-mapi
 Version: 3.4.3
-Release: 4%{?dist}
+Release: 5%{?dist}
 Group: Applications/Productivity
 Summary: Evolution extension for MS Exchange 2007 servers
 License: LGPLv2+
@@ -22,6 +22,7 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 Patch01: evolution-mapi-3.4.3-send-failure.patch
 Patch02: evolution-mapi-3.4.3-openstream.patch
 Patch03: evolution-mapi-3.4.3-namedids.patch
+Patch04: evolution-mapi-3.4.3-krbauth.patch
 
 ### Dependencies ###
 
@@ -61,6 +62,7 @@ Development files needed for building things which link against %{name}.
 %patch01 -p1 -b .send-failure
 %patch02 -p1 -b .openstream
 %patch03 -p1 -b .namedids
+%patch04 -p1 -b .krbauth
 
 %build
 
@@ -119,6 +121,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/pkgconfig/libexchangemapi-1.0.pc
 
 %changelog
+* Fri Jun 29 2012 Milan Crha <mcrha at redhat.com> - 3.4.3-5
+- Add patch for Red Hat bug #834798 (Kerberos authentication doesn't work)
+
 * Thu Jun 28 2012 Milan Crha <mcrha at redhat.com> - 3.4.3-4
 - Add patch for Gnome bug #678952 (Some named properties not converted)
 


More information about the scm-commits mailing list