[openchange/f15] Add patch for Red Hat bug #694374 (crash with X400 addresses)

Milan Crha mcrha at fedoraproject.org
Wed May 11 06:25:40 UTC 2011


commit 544d74a1ad1692b94588c2200c0fb01e769142f5
Author: Milan Crha <mcrha at redhat.com>
Date:   Wed May 11 08:25:21 2011 +0200

    Add patch for Red Hat bug #694374 (crash with X400 addresses)

 openchange-0.9-X400-addresses.patch |  132 +++++++++++++++++++++++++++++++++++
 openchange.spec                     |    9 ++-
 2 files changed, 140 insertions(+), 1 deletions(-)
---
diff --git a/openchange-0.9-X400-addresses.patch b/openchange-0.9-X400-addresses.patch
new file mode 100644
index 0000000..7ac4aef
--- /dev/null
+++ b/openchange-0.9-X400-addresses.patch
@@ -0,0 +1,132 @@
+diff -ru openchange-0.9-COCHRANE.orig/exchange.idl openchange-0.9-COCHRANE/exchange.idl
+--- openchange-0.9-COCHRANE.orig/exchange.idl	2011-04-29 16:31:23.000000000 -0700
++++ openchange-0.9-COCHRANE/exchange.idl	2011-04-29 16:36:19.000000000 -0700
+@@ -1181,46 +1181,60 @@
+ 		DISTRIBUTION_LIST	= 0x1
+ 	} addr_type;
+ 
+-	typedef  [flag(NDR_NOALIGN)]struct {
+-		uint8		organization_length;
+-		addr_type	addr_type;
+-		astring		username;
+-	} RecipExchange;
++	typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
++		[case(0x1)] uint8	prefix_size;
++		[default];
++	} recipient_AddressPrefixUsed;
+ 
+-	typedef [flag(NDR_NOALIGN)] struct {
+-	} RecipSMTP;
++	typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
++		[case(0x1)] addr_type	display_type;
++		[default];
++	} recipient_DisplayType;
+ 
+ 	typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
+-		[case(0x1)] RecipExchange	EXCHANGE;
+-		[case(0x3)] RecipSMTP		SMTP;
++		[case(0x1)] astring	recipient_x500name;
+ 		[default];
+-	} recipient_type;
++	} recipient_X500DN;
++
++	/* We're covering the PersonalDistributionList1 (0x0006) and PersonalDistributionList2
++           (0x0007) variations here, since we mask off the low bit in the switch. */
++	typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
++		[case(0x6)] SBinary_short			entryid;
++		[default];
++	} recipient_EntryId;
++
++	/* We're covering the PersonalDistributionList1 (0x0006) and PersonalDistributionList2
++           (0x0007) variations here, since we mask off the low bit in the switch. */
++	typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
++		[case(0x6)] SBinary_short			searchkey;
++		[default];
++	} recipient_SearchKey;
++
++	/* Present if the Type field is set to NoType (0x0) and the O flag (0x8000) is set */
++	typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
++		[case(0x8000)] astring				lpszA;
++		[default];
++	} recipient_AddressType;
+ 
+ 	typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
+-		[case(0x0)];
+ 		[case(0x400)] astring				lpszA;
+ 		[case(0x600)][flag(STR_NULLTERM)] string	lpszW;
+ 		[default];
+ 	} recipient_SimpleDisplayName;
+ 
+ 	typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
+-		[case(0x0)];
+-		[case(0x60)];
+-		[case(0x260)];
+ 		[case(0x20)] astring				lpszA;
+ 		[case(0x220)][flag(STR_NULLTERM)] string	lpszW;
+ 		[default];
+ 	} recipient_TransmittableDisplayName;
+ 
+ 	typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
+-		[case(0x0)];
+ 		[case(0x10)] astring				lpszA;
+ 		[case(0x210)][flag(STR_NULLTERM)] string	lpszW;
+ 		[default];
+ 	} recipient_DisplayName;
+ 
+ 	typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
+-		[case(0x0)];
+ 		[case(0x8)] astring				lpszA;
+ 		[case(0x208)][flag(STR_NULLTERM)] string	lpszW;
+ 		[default];
+@@ -1228,13 +1242,20 @@
+ 
+ 	typedef [flag(NDR_NOALIGN)] struct {
+ 		uint16									RecipientFlags;
+-		[switch_is(RecipientFlags & 0x7)]   recipient_type			type;
+-		[switch_is(RecipientFlags & 0x208)] recipient_EmailAddress	       	EmailAddress;
+-		[switch_is(RecipientFlags & 0x210)] recipient_DisplayName		DisplayName;
+-		[switch_is(RecipientFlags & 0x600)] recipient_SimpleDisplayName    	SimpleDisplayName;
+-		[switch_is(RecipientFlags & 0x260)] recipient_TransmittableDisplayName	TransmittableDisplayName;
++		[switch_is(RecipientFlags & 0x0007)] recipient_AddressPrefixUsed	AddressPrefixUsed;
++		[switch_is(RecipientFlags & 0x0007)] recipient_DisplayType		DisplayType;
++		[switch_is(RecipientFlags & 0x0007)] recipient_X500DN			X500DN;
++		[switch_is(RecipientFlags & 0x0006)] recipient_EntryId			EntryId;
++		[switch_is(RecipientFlags & 0x0006)] recipient_SearchKey		SearchKey;
++		[switch_is(RecipientFlags & 0x8007)] recipient_AddressType		AddressType;
++		[switch_is(RecipientFlags & 0x0208)] recipient_EmailAddress		EmailAddress;
++		[switch_is(RecipientFlags & 0x0210)] recipient_DisplayName		DisplayName;
++		[switch_is(RecipientFlags & 0x0600)] recipient_SimpleDisplayName	SimpleDisplayName;
++		[switch_is(RecipientFlags & 0x0220)] recipient_TransmittableDisplayName	TransmittableDisplayName;
+ 		uint16									prop_count;
++// TODO: figure out if "layout" can go
+ 		uint8									layout;
++// TODO: convert this to a proper structure - see if we already have one.
+ 		[flag(NDR_REMAINING)] DATA_BLOB						prop_values;
+ 	} RecipientRow;
+ 
+diff -ru openchange-0.9-COCHRANE.orig/libmapi/IMessage.c openchange-0.9-COCHRANE/libmapi/IMessage.c
+--- openchange-0.9-COCHRANE.orig/libmapi/IMessage.c	2011-04-29 16:31:23.000000000 -0700
++++ openchange-0.9-COCHRANE/libmapi/IMessage.c	2011-04-29 16:36:19.000000000 -0700
+@@ -781,17 +781,17 @@
+ 		switch (RecipientRow->RecipientFlags & 0x7) {
+ 		case 0x1: 
+ 		  //			RecipientRow->type.EXCHANGE.organization_length = mapi_recipients_get_org_length(session->profile);
+-			RecipientRow->type.EXCHANGE.organization_length = 0;
+-			RecipientRow->type.EXCHANGE.addr_type = SINGLE_RECIPIENT;
++			RecipientRow->AddressPrefixUsed.prefix_size = 0;
++			RecipientRow->DisplayType.display_type = SINGLE_RECIPIENT;
+ 			switch (RecipientRow->RecipientFlags & 0x200) {
+ 			case 0x0:
+-				RecipientRow->type.EXCHANGE.username = (const char *) find_SPropValue_data(aRow, PR_EMAIL_ADDRESS);
++				RecipientRow->X500DN.recipient_x500name = (const char *) find_SPropValue_data(aRow, PR_EMAIL_ADDRESS);
+ 				break;
+ 			case 0x200:
+-				RecipientRow->type.EXCHANGE.username = (const char *) find_SPropValue_data(aRow, PR_EMAIL_ADDRESS_UNICODE);
++				RecipientRow->X500DN.recipient_x500name = (const char *) find_SPropValue_data(aRow, PR_EMAIL_ADDRESS_UNICODE);
+ 				break;
+ 			}
+-			size += sizeof(uint32_t) + strlen(RecipientRow->type.EXCHANGE.username) + 1;
++			size += sizeof(uint32_t) + strlen(RecipientRow->X500DN.recipient_x500name) + 1;
+ 			break;
+ 		case 0x3:
+ 			size += sizeof(uint16_t);
diff --git a/openchange.spec b/openchange.spec
index ba8d40a..90c40dc 100644
--- a/openchange.spec
+++ b/openchange.spec
@@ -13,7 +13,7 @@
 
 Name: openchange
 Version: 0.9
-Release: 16%{?dist}
+Release: 17%{?dist}
 Group: Applications/System
 Summary: Provides access to Microsoft Exchange servers using native protocols
 License: GPLv3+ and Public Domain
@@ -61,6 +61,9 @@ Patch4: openchange-0.9-send-message.patch
 # Gnome bug #632784
 Patch5: openchange-0.9-unicode-props.patch
 
+# RH bug #694374
+Patch6: openchange-0.9-X400-addresses.patch
+
 %description
 OpenChange provides libraries to access Microsoft Exchange servers
 using native protocols.
@@ -122,6 +125,7 @@ This package provides the server elements for OpenChange.
 %patch3 -p1 -b .talloc-doublefree
 %patch4 -p1 -b .send-message
 %patch5 -p1 -b .unicode-props
+%patch6 -p1 -b .X400-addresses
 
 %build
 %configure
@@ -252,6 +256,9 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %changelog
+* Wed May 11 2011 Milan Crha <mcrha at redhat.com> - 0.9-17
+- Add patch for Red Hat bug #694374 (crash with X400 addresses)
+
 * Tue Apr 26 2011 Milan Crha <mcrha at redhat.com> - 0.9-16
 - Add patch for Gnome bug #632784 (send to recipients with Unicode letters in a name)
 


More information about the scm-commits mailing list