[openchange/f16] Add patch to not use mapi_ctx->session as a TALLOC_CTX (OpenChange issue #366)

Milan Crha mcrha at fedoraproject.org
Fri Aug 5 17:38:15 UTC 2011


commit 282c58840dce21cb1259b7ed81ef0f3bdf43f5ca
Author: Milan Crha <mcrha at redhat.com>
Date:   Fri Aug 5 19:37:54 2011 +0200

    Add patch to not use mapi_ctx->session as a TALLOC_CTX (OpenChange issue #366)

 openchange-0.11-session-as-memctx.patch |   24 ++++++++++++++++++++++++
 openchange.spec                         |    5 +++++
 2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/openchange-0.11-session-as-memctx.patch b/openchange-0.11-session-as-memctx.patch
new file mode 100644
index 0000000..9cf33d3
--- /dev/null
+++ b/openchange-0.11-session-as-memctx.patch
@@ -0,0 +1,24 @@
+diff -up ./libmapi/cdo_mapi.c.mem_ctx ./libmapi/cdo_mapi.c
+--- ./libmapi/cdo_mapi.c.mem_ctx	2011-08-05 18:26:05.070128887 +0200
++++ ./libmapi/cdo_mapi.c	2011-08-05 18:26:25.964381868 +0200
+@@ -131,7 +131,7 @@ _PUBLIC_ enum MAPISTATUS MapiLogonProvid
+ 	
+ 	/* If the session doesn't exist, create a new one */
+ 	if (!*session) {
+-		el = talloc_zero((TALLOC_CTX *)mapi_ctx->session, struct mapi_session);
++		el = talloc_zero(mapi_ctx->mem_ctx, struct mapi_session);
+ 		memset(el->logon_ids, 0, 255);
+ 		el->mapi_ctx = mapi_ctx;
+ 		OPENCHANGE_RETVAL_IF(!el, MAPI_E_NOT_ENOUGH_RESOURCES, NULL);
+diff -up ./libmapi/IProfAdmin.c.mem_ctx ./libmapi/IProfAdmin.c
+--- ./libmapi/IProfAdmin.c.mem_ctx	2011-08-05 18:26:22.452339353 +0200
++++ ./libmapi/IProfAdmin.c	2011-08-05 18:26:28.813416329 +0200
+@@ -748,7 +748,7 @@ _PUBLIC_ enum MAPISTATUS LoadProfile(str
+ 	OPENCHANGE_RETVAL_IF(!mapi_ctx->session, MAPI_E_NOT_INITIALIZED, NULL);
+ 	OPENCHANGE_RETVAL_IF(!profile, MAPI_E_INVALID_PARAMETER, NULL);
+ 
+-	mem_ctx = (TALLOC_CTX *) mapi_ctx->session;
++	mem_ctx = mapi_ctx->mem_ctx;
+ 
+ 	profile->credentials = cli_credentials_init(mem_ctx);
+ 	OPENCHANGE_RETVAL_IF(!profile->credentials, MAPI_E_NOT_ENOUGH_RESOURCES, NULL);
diff --git a/openchange.spec b/openchange.spec
index 1a45bb4..8d41e35 100644
--- a/openchange.spec
+++ b/openchange.spec
@@ -55,6 +55,9 @@ Patch2: openchange-0.10.9-TF16S2-fix-fedora-build.patch
 # Extra linker flags for samba/libsamba-util-common.so
 Patch3: samba-util-common-workaround.patch
 
+# http://tracker.openchange.org/issues/366
+Patch4: openchange-0.11-session-as-memctx.patch
+
 %description
 OpenChange provides libraries to access Microsoft Exchange servers
 using native protocols.
@@ -114,6 +117,7 @@ This package provides the server elements for OpenChange.
 %patch1 -p1 -b .generate-xml-doc
 %patch2 -p0 -b .fix-build
 %patch3 -p1 -b .samba-util-common-workaround
+%patch4 -p1 -b .session-as-memctx
 
 %build
 %configure
@@ -246,6 +250,7 @@ rm -rf $RPM_BUILD_ROOT
 %changelog
 * Mon Aug 05 2011 Milan Crha <mcrha at redhat.com> - 0.11-1
 - Update to OpenChange 0.11 Transporter upstream release
+- Add patch to not use mapi_ctx->session as a TALLOC_CTX (OpenChange issue #366)
 
 * Wed Apr 6 2011 Matthew Barnes <mbarnes at redhat.com> - 0.10.9-4
 - OpenChange relies on a private Samba 4 library (libsamba-util-common).


More information about the scm-commits mailing list