[Pkg-samba-maint] r2845 - in trunk/openchange: . .bzr-builddeb debian libmapi libocpf mapiproxy mapiproxy/libmapiproxy mapiproxy/libmapistore mapiproxy/modules torture utils utils/mapitest/modules
jelmer at alioth.debian.org
jelmer at alioth.debian.org
Fri Jun 12 20:26:29 UTC 2009
tags 525890 pending
tags 524694 pending
thanks
Author: jelmer
Date: 2009-06-12 20:26:28 +0000 (Fri, 12 Jun 2009)
New Revision: 2845
Added:
trunk/openchange/debian/openchangeserver.docs
Modified:
trunk/openchange/.bzr-builddeb/default.conf
trunk/openchange/ChangeLog
trunk/openchange/debian/changelog
trunk/openchange/debian/control
trunk/openchange/exchange.idl
trunk/openchange/libmapi/property.c
trunk/openchange/libmapi/simple_mapi.c
trunk/openchange/libocpf/ocpf_api.c
trunk/openchange/libocpf/ocpf_write.c
trunk/openchange/mapiproxy/dcesrv_mapiproxy_proto.h
trunk/openchange/mapiproxy/dcesrv_mapiproxy_unused.c
trunk/openchange/mapiproxy/libmapiproxy/openchangedb.c
trunk/openchange/mapiproxy/libmapistore/mapistore_backend.c
trunk/openchange/mapiproxy/libmapistore/mapistore_processing.c
trunk/openchange/mapiproxy/libmapistore/mapistore_tdb_wrap.c
trunk/openchange/mapiproxy/modules/mpm_cache.c
trunk/openchange/ndr_mapi.c
trunk/openchange/torture/mapi_permissions.c
trunk/openchange/torture/mapi_sendattach.c
trunk/openchange/torture/nspi_resolvenames.c
trunk/openchange/utils/exchange2mbox.c
trunk/openchange/utils/mapitest/modules/module_oxcfold.c
trunk/openchange/utils/mapitest/modules/module_oxcprpt.c
trunk/openchange/utils/mapitest/modules/module_oxomsg.c
trunk/openchange/utils/mapitest/modules/module_oxorule.c
trunk/openchange/utils/openchangeclient.c
Log:
* Fix missing dependencies of libmapi-dev. (Closes: #525884, Closes: #525890)
* Include howto in openchangeserver package. (Closes: #524694)
Modified: trunk/openchange/.bzr-builddeb/default.conf
===================================================================
--- trunk/openchange/.bzr-builddeb/default.conf 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/.bzr-builddeb/default.conf 2009-06-12 20:26:28 UTC (rev 2845)
@@ -1,3 +1,7 @@
[BUILDDEB]
export-upstream = https://svn.openchange.org/openchange/trunk
export-upstream-revision = tag:libmapi-$UPSTREAM_VERSION
+merge = True
+
+[HOOKS]
+pre-build = ./autogen.sh
Modified: trunk/openchange/ChangeLog
===================================================================
--- trunk/openchange/ChangeLog 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/ChangeLog 2009-06-12 20:26:28 UTC (rev 2845)
@@ -1,3 +1,74 @@
+2009-05-28
+ jkerihuel
+ [r1350]
+ Patch from Erik Hovland <erik at hovland.org>:
+
+ Initializes variables to make sure they aren't used uninitialized.
+
+ Ref ticket #153
+ [r1349]
+ - Add sanity check on mapitest_common creation routines within
+ mapitest modules
+
+ - Apply patch from Erik Hovland <erik at hovland.org>: check return
+ types.
+ [r1348]
+ Patch From Erik Hovland <erik at hovland.org>
+
+ In torture_rpc_mapi_sendattach a call is made to the system function
+ read at line 199. The return value of read is assigned to read_size,
+ which happens to be of unsigned type. So if read returns -1 (which it
+ can) it will not be noticed. The patch changes the type to ssize_t
+ (signed) and checks for -1 as well as zero to break out of the loop.
+
+ Ref ticket #156
+ [r1347]
+ Patch from Erik Hovland <erik at hovland.org>
+
+ 1. In mapiproxy, the directory handle dir will be leaked after it is
+ done being used.
+ 2. exchange2mbox main() should use exit at line 785 just like all of
+ the other error paths so that we don't leak anything
+
+ ref. ticket #157
+ [r1346]
+ Patch from Erik Hovland <erik at hovland.org>
+
+ Adds a #include config.h to suppress compiler warnings for vasprintf
+ [r1345]
+ Patch from Erik Hovland <erik at hovland.org>:
+
+ Make sure pointers are valid before dereferencing
+ 1. lpProps 'might' be null
+ 2. Add folder to variables checked before moving on.
+ 4. Check nprop->guid before giving to strcmp, two times
+ 6. Check definition before handing to strlen (which will dereference
+ it) Reworked this one to include talloc_free
+ 7. Check MessageClass? before handing to strncasecmp
+ 8. Check backend, return if null.
+ 10. Don't print out anything if lpProp is null
+ 11. Check attach_size before dereferencing
+
+2009-05-25
+ jkerihuel
+ [r1343]
+ Fix pull structure for QueryRows reply when no RowData is available
+
+2009-05-07
+ jkerihuel
+ [r1341]
+ - Add preliminary IDL support for Exchange 2003/2007 EMSMDB RPC calls:
+ * EcDoConnectEx
+ * EcDoRpcExt2
+
+ - Add LZxpress and XorMagic support to EcDoRpcExt2 request/reply
+ blob. However it doesn't yet support Chained calls.
+
+ - Add AuxInfo/AUX_HEADER structures and IDL
+
+ - Refactor mapi_request and mapi_response: move obfuscate_data calls
+ up to the EcDoRpc layer
+
2009-04-27
jkerihuel
[r1339]
Modified: trunk/openchange/debian/changelog
===================================================================
--- trunk/openchange/debian/changelog 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/debian/changelog 2009-06-12 20:26:28 UTC (rev 2845)
@@ -1,11 +1,13 @@
-openchange (1:0.8.2+svn1340-1) experimental; urgency=low
+openchange (1:0.8.2+svn1351-1) experimental; urgency=low
* New upstream snapshot.
* Build exchange2ical.
* Add missing dependency on libtevent-dev. (Closes: #524000)
+ * Fix missing dependencies of libmapi-dev. (Closes: #525884, Closes: #525890)
* Add libmapi++ package.
+ * Include howto in openchangeserver package. (Closes: #524694)
- -- Jelmer Vernooij <jelmer at debian.org> Tue, 14 Apr 2009 18:05:32 +0200
+ -- Jelmer Vernooij <jelmer at debian.org> Fri, 12 Jun 2009 22:17:01 +0200
openchange (1:0.8-2) experimental; urgency=low
Modified: trunk/openchange/debian/control
===================================================================
--- trunk/openchange/debian/control 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/debian/control 2009-06-12 20:26:28 UTC (rev 2845)
@@ -35,7 +35,7 @@
Package: libmapi-dev
Section: libdevel
Architecture: any
-Depends: libc6-dev, libmapi0 (= ${binary:Version}), ${misc:Depends}
+Depends: libc6-dev, libmapi0 (= ${binary:Version}), ${misc:Depends}, libtalloc-dev, libdcerpc-dev, libndr-dev, libldb-samba4-dev | libldb-dev, libsamba-hostconfig-dev, libtevent-dev
Description: Development files for the MAPI client library
This library provides a client-side implementation of the MAPI protocol
that is used by Microsoft Exchange and Outlook.
Added: trunk/openchange/debian/openchangeserver.docs
===================================================================
--- trunk/openchange/debian/openchangeserver.docs (rev 0)
+++ trunk/openchange/debian/openchangeserver.docs 2009-06-12 20:26:28 UTC (rev 2845)
@@ -0,0 +1 @@
+doc/howto.txt
Modified: trunk/openchange/exchange.idl
===================================================================
--- trunk/openchange/exchange.idl 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/exchange.idl 2009-06-12 20:26:28 UTC (rev 2845)
@@ -3733,7 +3733,7 @@
} mapi_response;
- [public] MAPISTATUS EcDoRpc(
+ [public,nopull,nopush] MAPISTATUS EcDoRpc(
[in,out] policy_handle *handle,
[in,out] uint32 size,
[in,out] uint32 offset,
@@ -3800,31 +3800,409 @@
/*****************/
/* Function 0xa */
+ typedef [public,bitmap16bit] bitmap {
+ RHEF_Compressed = 0x0001,
+ RHEF_XorMagic = 0x0002,
+ RHEF_Last = 0x0004
+ } RPC_HEADER_EXT_Flags;
+
+ typedef [public] struct {
+ uint16 Version;
+ RPC_HEADER_EXT_Flags Flags;
+ uint16 Size;
+ uint16 SizeActual;
+ } RPC_HEADER_EXT;
+
+ typedef [enum8bit,flag(NDR_PAHEX)] enum {
+ AUX_TYPE_PERF_REQUESTID = 0x01,
+ AUX_TYPE_PERF_CLIENTDINFO = 0x02,
+ AUX_TYPE_PERF_SERVERINFO = 0x03,
+ AUX_TYPE_PERF_SESSIONINFO = 0x04,
+ AUX_TYPE_PERF_DEFMDB_SUCCESS = 0x05,
+ AUX_TYPE_PERF_DEFGC_SUCCESS = 0x06,
+ AUX_TYPE_PERF_MDB_SUCCESS = 0x07,
+ AUX_TYPE_PERF_GC_SUCCESS = 0x08,
+ AUX_TYPE_PERF_FAILURE = 0x09,
+ AUX_TYPE_CLIENT_CONTROL = 0x0A,
+ AUX_TYPE_PERF_PROCESSINFO = 0x0B,
+ AUX_TYPE_PERF_BG_DEFMDB_SUCCESS = 0x0C,
+ AUX_TYPE_PERF_BG_DEFGC_SUCCESS = 0x0D,
+ AUX_TYPE_PERF_BG_MDB_SUCCESS = 0x0E,
+ AUX_TYPE_PERF_BG_GC_SUCCESS = 0x0F,
+ AUX_TYPE_PERF_BG_FAILURE = 0x10,
+ AUX_TYPE_PERF_FG_DEFMDB_SUCCESS = 0x11,
+ AUX_TYPE_PERF_FG_DEFGC_SUCCESS = 0x12,
+ AUX_TYPE_PERF_FG_MDB_SUCCESS = 0x13,
+ AUX_TYPE_PERF_FG_GC_SUCCESS = 0x14,
+ AUX_TYPE_PERF_FG_FAILURE = 0x15,
+ AUX_TYPE_OSVERSIONINFO = 0x16,
+ AUX_TYPE_EXORGINFO = 0x17
+ } AUX_HEADER_TYPE_1;
+
+ typedef [enum8bit,flag(NDR_PAHEX)] enum {
+ AUX_TYPE_PERF_SESSIONINFO_2 = 0x04,
+ AUX_TYPE_PERF_MDB_SUCCESS_2 = 0x07,
+ AUX_TYPE_PERF_GC_SUCCESS_2 = 0x08,
+ AUX_TYPE_PERF_FAILURE_2 = 0x09
+ } AUX_HEADER_TYPE_2;
+
+ typedef [public,enum8bit,flag(NDR_PAHEX)] enum {
+ AUX_VERSION_1 = 0x1,
+ AUX_VERSION_2 = 0x2
+ } AUX_VERSION;
+
+ typedef [public,switch_type(uint8)] union {
+ [case(AUX_VERSION_1)] AUX_HEADER_TYPE_1 Type;
+ [case(AUX_VERSION_2)] AUX_HEADER_TYPE_2 Type_2;
+ [default];
+ } AUX_HEADER_TYPE_ENUM;
+
+ /*************************/
+ /* AUX_HEADER case (0x1) */
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 SessionID;
+ uint16 RequestID;
+ } AUX_PERF_REQUESTID;
+
+ /*************************/
+ /* AUX_HEADER case (0x2) */
+ typedef [public,enum16bit, flag(NDR_PAHEX)] enum {
+ CLIENTMODE_UNKNOWN = 0x0,
+ CLIENTMODE_CLASSIC = 0x1,
+ CLIENTMODE_CACHED = 0x2
+ } ClientMode;
+
+ typedef [public,flag(NDR_NOALIGN)] struct {
+ uint32 AdapterSpeed;
+ uint16 ClientID;
+ uint16 MachineNameOffset;
+ uint16 UserNameOffset;
+ uint16 ClientIPSize;
+ uint16 ClientIPOffset;
+ uint16 ClientIPMaskSize;
+ uint16 ClientIPMaskOffset;
+ uint16 AdapterNameOffset;
+ uint16 MacAddressSize;
+ uint16 MacAddressOffset;
+ ClientMode ClientMode;
+ uint16 Reserved;
+ uint8 MacAddress[MacAddressSize];
+ uint8 ClientIP[ClientIPSize];
+ uint8 ClientIPMask[ClientIPMaskSize];
+ nstring MachineName;
+ nstring UserName;
+ nstring AdapterName;
+ } AUX_PERF_CLIENTINFO;
+
+ /*************************/
+ /* AUX_HEADER case (0x3) */
+ typedef [enum16bit,flag(NDR_PAHEX)] enum {
+ SERVERTYPE_UNKNOWN = 0x0,
+ SERVERTYPE_PRIVATE = 0x1,
+ SERVERTYPE_PUBLIC = 0x2,
+ SERVERTYPE_DIRECTORY = 0x3,
+ SERVERTYPE_REFERRAL = 0x4
+ } SERVERINFO_ServerType;
+
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 ServerID;
+ SERVERINFO_ServerType ServerType;
+ uint16 ServerDNOffset;
+ uint16 ServerNameOffset;
+ nstring ServerDN;
+ nstring ServerName;
+ } AUX_PERF_SERVERINFO;
+
+ /*************************/
+ /* AUX_HEADER case (0x4) */
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 SessionID;
+ uint16 Reserved;
+ GUID SessionGuid;
+ } AUX_PERF_SESSIONINFO;
+
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 SessionID;
+ uint16 Reserved;
+ GUID SessionGuid;
+ uint32 ConnectionID;
+ } AUX_PERF_SESSIONINFO_V2;
+
+ /**************************/
+ /* AUX_HEADER case (0x5) */
+ /* AUX_HEADER case (0xC) */
+ /* AUX_HEADER case (0x11) */
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint32 TimeSinceRequest;
+ uint32 TimeToCompleteRequest;
+ uint16 RequestID;
+ uint16 Reserved;
+ } AUX_PERF_DEFMDB_SUCCESS;
+
+ /**************************/
+ /* AUX_HEADER case (0x6) */
+ /* AUX_HEADER case (0xD) */
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 ServerID;
+ uint16 SessionID;
+ uint32 TimeSinceRequest;
+ uint32 TimeToCompleteRequest;
+ uint8 RequestOperation;
+ uint8 Reserved[3];
+ } AUX_PERF_DEFGC_SUCCESS;
+
+ /**************************/
+ /* AUX_HEADER case (0x7) */
+ /* AUX_HEADER case (0xE) */
+ /* AUX_HEADER case (0x13) */
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 ClientID;
+ uint16 ServerID;
+ uint16 SessionID;
+ uint16 RequestID;
+ uint32 TimeSinceRequest;
+ uint32 TimeToCompleteRequest;
+ } AUX_PERF_MDB_SUCCESS;
+
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 ProcessID;
+ uint16 ClientID;
+ uint16 ServerID;
+ uint16 SessionID;
+ uint16 RequestID;
+ uint16 Reserved;
+ uint32 TimeSinceRequest;
+ uint32 TimeToCompleteRequest;
+ } AUX_PERF_MDB_SUCCESS_V2;
+
+ /**************************/
+ /* AUX_HEADER case (0x8) */
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 ClientID;
+ uint16 ServerID;
+ uint16 SessionID;
+ uint16 Reserved_1;
+ uint32 TimeSinceRequest;
+ uint32 TimeToCompleteRequest;
+ uint8 RequestOperation;
+ uint8 Reserved_2[3];
+ } AUX_PERF_GC_SUCCESS;
+
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 ProcessID;
+ uint16 ClientID;
+ uint16 ServerID;
+ uint16 SessionID;
+ uint32 TimeSinceRequest;
+ uint32 TimeToCompleteRequest;
+ uint8 RequestOperation;
+ uint8 Reserved[3];
+ } AUX_PERF_GC_SUCCESS_V2;
+
+ /**************************/
+ /* AUX_HEADER case (0x9) */
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 ClientID;
+ uint16 ServerID;
+ uint16 SessionID;
+ uint16 RequestID;
+ uint32 TimeSinceRequest;
+ uint32 TimeToFailRequest;
+ MAPISTATUS ResultCode;
+ uint8 RequestOperation;
+ uint8 Reserved[3];
+ } AUX_PERF_FAILURE;
+
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 ProcessID;
+ uint16 ClientID;
+ uint16 ServerID;
+ uint16 SessionID;
+ uint16 RequestID;
+ uint16 Reserved_1;
+ uint32 TimeSinceRequest;
+ uint32 TimeToFailRequest;
+ MAPISTATUS ResultCode;
+ uint8 RequestOperation;
+ uint8 Reserved_2[3];
+ } AUX_PERF_FAILURE_V2;
+
+ /**************************/
+ /* AUX_HEADER case (0xA) */
+ typedef [bitmap32bit] bitmap {
+ ENABLE_PERF_SENDTOSERVER = 0x00000001,
+ ENABLE_PERF_SENDTOMAILBOX = 0x00000002,
+ ENABLE_COMPRESSION = 0x00000004,
+ ENABLE_HTTP_TUNNELING = 0x00000008,
+ ENABLE_PERF_SENDGCDATA = 0x00000010
+ } CLIENT_CONTROL_EnableFlags;
+
+ typedef [flag(NDR_NOALIGN)] struct {
+ CLIENT_CONTROL_EnableFlags EnableFlags;
+ uint32 ExpiryTime;
+ } AUX_CLIENT_CONTROL;
+
+ /*************************/
+ /* AUX_HEADER case (0xB) */
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint16 ProcessID;
+ uint16 Reserved1;
+ GUID ProcessGuid;
+ uint16 ProcessNameOffset;
+ uint16 Reserved2;
+ nstring ProcessName;
+ } AUX_PERF_PROCESSINFO;
+
+ /**************************/
+ /* AUX_HEADER case (0x16) */
+ typedef [flag(NDR_NOALIGN)] struct {
+ uint32 OSVersionInfoSize;
+ uint32 MajorVersion;
+ uint32 MinorVersion;
+ uint32 BuildNumber;
+ [subcontext(0), subcontext_size(132), flag(NDR_NOALIGN|NDR_REMAINING)] DATA_BLOB Reserved_1;
+ uint16 ServicePackMajor;
+ uint16 ServicePackMinor;
+ uint32 Reserved_2;
+ } AUX_OSVERSIONINFO;
+
+ /**************************/
+ /* AUX_HEADER case (0x17) */
+ typedef [bitmap32bit] bitmap {
+ PUBLIC_FOLDERS_ENABLED = 0x00000001
+ } EXORGINFO_OrgFlags;
+
+ typedef [flag(NDR_NOALIGN)] struct {
+ EXORGINFO_OrgFlags OrgFlags;
+ } AUX_EXORGINFO;
+
+ typedef [public,nodiscriminant,flag(NDR_NOALIGN)] union {
+ [case(AUX_TYPE_PERF_REQUESTID)] AUX_PERF_REQUESTID AUX_PERF_REQUESTID;
+ [case(AUX_TYPE_PERF_CLIENTDINFO)] AUX_PERF_CLIENTINFO AUX_PERF_CLIENTINFO;
+ [case(AUX_TYPE_PERF_SERVERINFO)] AUX_PERF_SERVERINFO AUX_PERF_SERVERINFO;
+ [case(AUX_TYPE_PERF_SESSIONINFO)] AUX_PERF_SESSIONINFO AUX_PERF_SESSIONINFO;
+ [case(AUX_TYPE_PERF_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS AUX_PERF_DEFMDB_SUCCESS;
+ [case(AUX_TYPE_PERF_DEFGC_SUCCESS)] AUX_PERF_DEFGC_SUCCESS AUX_PERF_DEFGC_SUCCESS;
+ [case(AUX_TYPE_PERF_MDB_SUCCESS)] AUX_PERF_MDB_SUCCESS AUX_PERF_MDB_SUCCESS;
+ [case(AUX_TYPE_PERF_GC_SUCCESS)] AUX_PERF_GC_SUCCESS AUX_PERF_GC_SUCCESS;
+ [case(AUX_TYPE_PERF_FAILURE)] AUX_PERF_FAILURE AUX_PERF_FAILURE;
+ [case(AUX_TYPE_CLIENT_CONTROL)] AUX_CLIENT_CONTROL AUX_CLIENT_CONTROL;
+ [case(AUX_TYPE_PERF_PROCESSINFO)] AUX_PERF_PROCESSINFO AUX_PERF_PROCESSINFO;
+ [case(AUX_TYPE_PERF_BG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS AUX_PERF_DEFMDB_SUCCESS;
+ [case(AUX_TYPE_PERF_BG_DEFGC_SUCCESS)] AUX_PERF_DEFGC_SUCCESS AUX_PERF_DEFGC_SUCCESS;
+ [case(AUX_TYPE_PERF_BG_MDB_SUCCESS)] AUX_PERF_MDB_SUCCESS AUX_PERF_MDB_SUCCESS;
+ [case(AUX_TYPE_PERF_BG_GC_SUCCESS)] AUX_PERF_GC_SUCCESS AUX_PERF_GC_SUCCESS;
+ [case(AUX_TYPE_PERF_BG_FAILURE)] AUX_PERF_FAILURE AUX_PERF_FAILURE;
+ [case(AUX_TYPE_PERF_FG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS AUX_PERF_DEFMDB_SUCCESS;
+ [case(AUX_TYPE_PERF_FG_DEFGC_SUCCESS)] AUX_PERF_DEFGC_SUCCESS AUX_PERF_DEFGC_SUCCESS;
+ [case(AUX_TYPE_PERF_FG_MDB_SUCCESS)] AUX_PERF_MDB_SUCCESS AUX_PERF_MDB_SUCCESS;
+ [case(AUX_TYPE_PERF_FG_GC_SUCCESS)] AUX_PERF_GC_SUCCESS AUX_PERG_GC_SUCCESS;
+ [case(AUX_TYPE_PERF_FG_FAILURE)] AUX_PERF_FAILURE AUX_PERF_FAILURE;
+ [case(AUX_TYPE_OSVERSIONINFO)] AUX_OSVERSIONINFO AUX_OSVERSIONINFO;
+ [case(AUX_TYPE_EXORGINFO)] AUX_EXORGINFO AUX_EXORGINFO;
+ [default][flag(NDR_REMAINING|NDR_NOALIGN)] DATA_BLOB Payload;
+ } AUX_HEADER_TYPE_UNION_1;
+
+ typedef [public,nodiscriminant,flag(NDR_NOALIGN)] union {
+ [case(AUX_TYPE_PERF_REQUESTID)] AUX_PERF_REQUESTID AUX_PERF_REQUESTID;
+ [case(AUX_TYPE_PERF_CLIENTDINFO)] AUX_PERF_CLIENTINFO AUX_PERF_CLIENTINFO;
+ [case(AUX_TYPE_PERF_SERVERINFO)] AUX_PERF_SERVERINFO AUX_PERF_SERVERINFO;
+ [case(AUX_TYPE_PERF_SESSIONINFO_2)] AUX_PERF_SESSIONINFO_V2 AUX_PERF_SESSIONINFO_V2; /* V2 specific */
+ [case(AUX_TYPE_PERF_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS AUX_PERF_DEFMDB_SUCCESS;
+ [case(AUX_TYPE_PERF_DEFGC_SUCCESS)] AUX_PERF_DEFGC_SUCCESS AUX_PERF_DEFGC_SUCCESS;
+ [case(AUX_TYPE_PERF_MDB_SUCCESS_2)] AUX_PERF_MDB_SUCCESS_V2 AUX_PERF_MDB_SUCCESS_V2; /* V2 specific */
+ [case(AUX_TYPE_PERF_GC_SUCCESS_2)] AUX_PERF_GC_SUCCESS_V2 AUX_PERF_GC_SUCCESS_V2; /* V2 specific */
+ [case(AUX_TYPE_PERF_FAILURE_2)] AUX_PERF_FAILURE_V2 AUX_PERF_FAILURE_V2; /* V2 specific*/
+ [case(AUX_TYPE_CLIENT_CONTROL)] AUX_CLIENT_CONTROL AUX_CLIENT_CONTROL;
+ [case(AUX_TYPE_PERF_PROCESSINFO)] AUX_PERF_PROCESSINFO AUX_PERF_PROCESSINFO;
+ [case(AUX_TYPE_PERF_BG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS AUX_PERF_DEFMDB_SUCCESS;
+ [case(AUX_TYPE_PERF_BG_DEFGC_SUCCESS)] AUX_PERF_DEFGC_SUCCESS AUX_PERF_DEFGC_SUCCESS;
+ [case(AUX_TYPE_PERF_BG_MDB_SUCCESS)] AUX_PERF_MDB_SUCCESS AUX_PERF_MDB_SUCCESS;
+ [case(AUX_TYPE_PERF_BG_GC_SUCCESS)] AUX_PERF_GC_SUCCESS AUX_PERF_GC_SUCCESS;
+ [case(AUX_TYPE_PERF_BG_FAILURE)] AUX_PERF_FAILURE AUX_PERF_FAILURE;
+ [case(AUX_TYPE_PERF_FG_DEFMDB_SUCCESS)] AUX_PERF_DEFMDB_SUCCESS AUX_PERF_DEFMDB_SUCCESS;
+ [case(AUX_TYPE_PERF_FG_DEFGC_SUCCESS)] AUX_PERF_DEFGC_SUCCESS AUX_PERF_DEFGC_SUCCESS;
+ [case(AUX_TYPE_PERF_FG_MDB_SUCCESS)] AUX_PERF_MDB_SUCCESS AUX_PERF_MDB_SUCCESS;
+ [case(AUX_TYPE_PERF_FG_GC_SUCCESS)] AUX_PERF_GC_SUCCESS AUX_PERG_GC_SUCCESS;
+ [case(AUX_TYPE_PERF_FG_FAILURE)] AUX_PERF_FAILURE AUX_PERF_FAILURE;
+ [case(AUX_TYPE_OSVERSIONINFO)] AUX_OSVERSIONINFO AUX_OSVERSIONINFO;
+ [case(AUX_TYPE_EXORGINFO)] AUX_EXORGINFO AUX_EXORGINFO;
+ [default][flag(NDR_REMAINING|NDR_NOALIGN)] DATA_BLOB Payload;
+ } AUX_HEADER_TYPE_UNION_2;
+
+ typedef [public,nopull,noprint,flag(NDR_NOALIGN)] struct {
+ uint16 Size;
+ AUX_VERSION Version;
+ uint8 Type;
+ [switch_is(Type)] AUX_HEADER_TYPE_UNION_1 Payload_1;
+ [switch_is(Type)] AUX_HEADER_TYPE_UNION_2 Payload_2;
+ } AUX_HEADER;
+
+ typedef [public,nopull,noprint] struct {
+ RPC_HEADER_EXT RPC_HEADER_EXT;
+ [subcontext(0), subcontext_size(RPC_HEADER_EXT.Size)] AUX_HEADER *AUX_HEADER;
+ } mapi2k7_AuxInfo;
+
+
MAPISTATUS EcDoConnectEx(
- [out] policy_handle *handle,
- [in,string,charset(DOS)] uint8 szUserDN[],
- [in] uint32 ulFlags,
- [in] uint32 ulConMod,
- [in] uint32 cbLimit,
- [in] uint32 ulCpid,
- [in] uint32 ulLcidString,
- [in] uint32 ulLcidSort,
- [in] uint32 ulIcxrLink,
- [in] uint16 usFCanConvertCodePages,
- [out] uint32 *pcmsPollsMax,
- [out] uint32 *pcRetry,
- [out] uint32 *pcmsRetryDelay,
- [out] uint32 *picxr,
- [out,unique,string,charset(DOS)]uint8 *szDNPrefix,
- [out,unique,string,charset(DOS)]uint8 *szDisplayName,
- [in] uint16 rgwClientVersion[3],
- [out] uint16 rgwServerVersion[3],
- [out] uint16 rgwBestVersion[3],
- [in,out] uint32 *pulTimeStamp,
- [in][subcontext(4),flag(NDR_REMAINING|NDR_NOALIGN)] DATA_BLOB rgbAuxIn,
- [in,out][range(0x0,0x1008)] uint32 *pcbAuxOut,
+ [out] policy_handle *handle,
+ [in,string,charset(DOS)] uint8 szUserDN[],
+ [in] uint32 ulFlags,
+ [in] uint32 ulConMod,
+ [in] uint32 cbLimit,
+ [in] uint32 ulCpid,
+ [in] uint32 ulLcidString,
+ [in] uint32 ulLcidSort,
+ [in] uint32 ulIcxrLink,
+ [in] uint16 usFCanConvertCodePages,
+ [out] uint32 *pcmsPollsMax,
+ [out] uint32 *pcRetry,
+ [out] uint32 *pcmsRetryDelay,
+ [out] uint32 *picxr,
+ [out,unique,string,charset(DOS)]uint8 *szDNPrefix,
+ [out,unique,string,charset(DOS)]uint8 *szDisplayName,
+ [in] uint16 rgwClientVersion[3],
+ [out] uint16 rgwServerVersion[3],
+ [out] uint16 rgwBestVersion[3],
+ [in,out] uint32 *pulTimeStamp,
+ [in,subcontext(4),flag(NDR_NOALIGN|NDR_REMAINING)] mapi2k7_AuxInfo *rgbAuxIn,
+ [in,out][range(0,0x1008)] uint32 *pcbAuxOut,
[in][flag(NDR_REMAINING)] DATA_BLOB data
);
+
+ /*****************/
+ /* Function 0xb */
+ typedef [public,bitmap32bit] bitmap {
+ pulFlags_NoCompression = 0x00000001,
+ pulFlags_NoXorMagic = 0x00000002,
+ pulFlags_Chain = 0x00000004
+ } pulFlags;
+
+ typedef [public,nopull] struct {
+ RPC_HEADER_EXT header;
+ [subcontext(0),flag(NDR_REMAINING|NDR_NOALIGN)] mapi_request *mapi_request;
+ } mapi2k7_request;
+
+ typedef [public,nopull] struct {
+ RPC_HEADER_EXT header;
+ [subcontext(0),flag(NDR_NOALIGN|NDR_REMAINING)] mapi_response *mapi_response;
+ } mapi2k7_response;
+
+ MAPISTATUS EcDoRpcExt2(
+ [in,out] policy_handle *handle,
+ [in,out] pulFlags *pulFlags,
+ [in,subcontext(4),flag(NDR_NOALIGN|NDR_REMAINING)] mapi2k7_request *rgbIn,
+ [in] uint32 cbIn,
+ [out] uint32 size,
+ [out] uint32 offset,
+ [out,subcontext(4),flag(NDR_NOALIGN|NDR_REMAINING)]mapi2k7_response *rgbOut,
+ [in,out][range(0,262144)] uint32 *pcbOut,
+ [in,subcontext(4),flag(NDR_NOALIGN|NDR_REMAINING)] mapi2k7_AuxInfo *rgbAuxIn,
+ [in] uint32 cbAuxIn,
+ [out,subcontext(4),flag(NDR_NOALIGN|NDR_REMAINING)]mapi2k7_AuxInfo *rgbAuxOut,
+ [in,out][range(0,4104)] uint32 *pcbAuxOut,
+ [out] uint32 *pullTransTime
+ );
}
[
Modified: trunk/openchange/libmapi/property.c
===================================================================
--- trunk/openchange/libmapi/property.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/libmapi/property.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -88,6 +88,9 @@
{
uint32_t i;
+ /* Sanity checks */
+ if (!lpProps) return NULL;
+
for (i = 0; lpProps[i].ulPropTag; i++) {
if (ulPropTag == lpProps[i].ulPropTag) {
return get_SPropValue_data(&lpProps[i]);
Modified: trunk/openchange/libmapi/simple_mapi.c
===================================================================
--- trunk/openchange/libmapi/simple_mapi.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/libmapi/simple_mapi.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -245,6 +245,7 @@
/* Sanity checks */
OPENCHANGE_RETVAL_IF(!global_mapi_ctx, MAPI_E_NOT_INITIALIZED, NULL);
OPENCHANGE_RETVAL_IF(!obj_store, MAPI_E_INVALID_PARAMETER, NULL);
+ OPENCHANGE_RETVAL_IF(!folder, MAPI_E_INVALID_PARAMETER, NULL);
store = (mapi_object_store_t *)obj_store->private_data;
OPENCHANGE_RETVAL_IF(!store, MAPI_E_NOT_INITIALIZED, NULL);
@@ -473,6 +474,8 @@
OPENCHANGE_RETVAL_IF(!obj_folder, MAPI_E_INVALID_PARAMETER, NULL);
OPENCHANGE_RETVAL_IF(!username, MAPI_E_INVALID_PARAMETER, NULL);
+ rowList.padding = 0;
+
mem_ctx = talloc_named(NULL, 0, "AddUserPermission");
/* query Address book */
@@ -547,6 +550,8 @@
OPENCHANGE_RETVAL_IF(!obj_folder, MAPI_E_INVALID_PARAMETER, NULL);
OPENCHANGE_RETVAL_IF(!username, MAPI_E_INVALID_PARAMETER, NULL);
+ rowList.padding = 0;
+
mem_ctx = talloc_named(NULL, 0, "ModifyUserPermission");
SPropTagArray = set_SPropTagArray(mem_ctx, 2, PR_ENTRYID, PR_DISPLAY_NAME);
Modified: trunk/openchange/libocpf/ocpf_api.c
===================================================================
--- trunk/openchange/libocpf/ocpf_api.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/libocpf/ocpf_api.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -261,7 +261,7 @@
*/
for (el = ocpf->nprops; el->next; el = el->next) {
OCPF_RETVAL_IF((el->OOM && !strcmp(el->OOM, nprop->OOM)) &&
- (el->oleguid && !strcmp(el->oleguid, nprop->guid)),
+ (el->oleguid && nprop->guid && !strcmp(el->oleguid, nprop->guid)),
OCPF_WARN_OOM_REGISTERED, element);
}
@@ -277,7 +277,7 @@
*/
for (el = ocpf->nprops; el->next; el = el->next) {
OCPF_RETVAL_IF((el->mnid_string && !strcmp(el->mnid_string, nprop->mnid_string)) &&
- (el->oleguid && !strcmp(el->oleguid, nprop->guid)),
+ (el->oleguid && nprop->guid && !strcmp(el->oleguid, nprop->guid)),
OCPF_WARN_STRING_REGISTERED, element);
}
@@ -298,7 +298,7 @@
*/
for (el = ocpf->nprops; el->next; el = el->next) {
OCPF_RETVAL_IF((el->mnid_id == nprop->mnid_id) &&
- (el->oleguid && !strcmp(el->oleguid, nprop->guid)),
+ (el->oleguid && nprop->guid && !strcmp(el->oleguid, nprop->guid)),
OCPF_WARN_LID_REGISTERED, element);
}
element->kind = OCPF_MNID_ID;
Modified: trunk/openchange/libocpf/ocpf_write.c
===================================================================
--- trunk/openchange/libocpf/ocpf_write.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/libocpf/ocpf_write.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -608,10 +608,12 @@
ocpf_write_get_guid_name(nelement->oleguid));
}
- len = fwrite(definition, strlen(definition), 1, fp);
+ if (definition) {
+ len = fwrite(definition, strlen(definition), 1, fp);
+ talloc_free(definition);
+ }
+
len = fwrite(line, strlen(line), 1, fp);
-
- talloc_free(definition);
talloc_free(line);
found = false;
}
Modified: trunk/openchange/mapiproxy/dcesrv_mapiproxy_proto.h
===================================================================
--- trunk/openchange/mapiproxy/dcesrv_mapiproxy_proto.h 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/mapiproxy/dcesrv_mapiproxy_proto.h 2009-06-12 20:26:28 UTC (rev 2845)
@@ -133,11 +133,11 @@
enum MAPISTATUS dcesrv_NspiGetIDsFromNames(struct dcesrv_call_state *, TALLOC_CTX *,struct NspiGetIDsFromNames *);
enum MAPISTATUS dcesrv_NspiResolveNames(struct dcesrv_call_state *, TALLOC_CTX *,struct NspiResolveNames *);
enum MAPISTATUS dcesrv_NspiResolveNamesW(struct dcesrv_call_state *, TALLOC_CTX *,struct NspiResolveNamesW *);
+
+/* EMSMDB protocol functions */
enum MAPISTATUS dcesrv_EcDoConnect(struct dcesrv_call_state *, TALLOC_CTX *,struct EcDoConnect *);
enum MAPISTATUS dcesrv_EcDoDisconnect(struct dcesrv_call_state *, TALLOC_CTX *,struct EcDoDisconnect *);
enum MAPISTATUS dcesrv_EcDoRpc(struct dcesrv_call_state *, TALLOC_CTX *,struct EcDoRpc *);
-
-
void dcesrv_EcGetMoreRpc(struct dcesrv_call_state *, TALLOC_CTX *,struct EcGetMoreRpc *);
enum MAPISTATUS dcesrv_EcRRegisterPushNotification(struct dcesrv_call_state *, TALLOC_CTX *,struct EcRRegisterPushNotification *);
enum MAPISTATUS dcesrv_EcRUnregisterPushNotification(struct dcesrv_call_state *, TALLOC_CTX *,struct EcRUnregisterPushNotification *);
@@ -146,6 +146,7 @@
void dcesrv_EcRNetGetDCName(struct dcesrv_call_state *, TALLOC_CTX *,struct EcRNetGetDCName *);
void dcesrv_EcDoRpcExt(struct dcesrv_call_state *, TALLOC_CTX *,struct EcDoRpcExt *);
enum MAPISTATUS dcesrv_EcDoConnectEx(struct dcesrv_call_state *, TALLOC_CTX *, struct EcDoConnectEx *);
+enum MAPISTATUS dcesrv_EcDoRpcExt2(struct dcesrv_call_state *, TALLOC_CTX *, struct EcDoRpcExt2 *);
void dcesrv_unknown_dummy(struct dcesrv_call_state *, TALLOC_CTX *,struct unknown_dummy *);
__END_DECLS
Modified: trunk/openchange/mapiproxy/dcesrv_mapiproxy_unused.c
===================================================================
--- trunk/openchange/mapiproxy/dcesrv_mapiproxy_unused.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/mapiproxy/dcesrv_mapiproxy_unused.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -758,6 +758,15 @@
DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
}
+/*
+ EcDoRpcExt2
+ */
+enum MAPISTATUS dcesrv_EcDoRpcExt2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
+ struct EcDoRpcExt2 *r)
+{
+ DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
+}
+
/*
endpoint server for the exchange_unknown pipe
*/
Modified: trunk/openchange/mapiproxy/libmapiproxy/openchangedb.c
===================================================================
--- trunk/openchange/mapiproxy/libmapiproxy/openchangedb.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/mapiproxy/libmapiproxy/openchangedb.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -284,8 +284,8 @@
/* Step 3. Find the longest ExplicitMessageClass matching MessageClass */
ldb_element = ldb_msg_find_element(res->msgs[0], "PidTagMessageClass");
for (i = 0, length = 0; i < ldb_element[0].num_values; i++) {
- if (!strncasecmp(MessageClass, (char *)ldb_element->values[i].data,
- strlen((char *)ldb_element->values[i].data)) &&
+ if (MessageClass && !strncasecmp(MessageClass, (char *)ldb_element->values[i].data,
+ strlen((char *)ldb_element->values[i].data)) &&
strlen((char *)ldb_element->values[i].data) > length) {
if (*ExplicitMessageClass && strcmp(*ExplicitMessageClass, "")) {
Modified: trunk/openchange/mapiproxy/libmapistore/mapistore_backend.c
===================================================================
--- trunk/openchange/mapiproxy/libmapistore/mapistore_backend.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/mapiproxy/libmapistore/mapistore_backend.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -62,6 +62,11 @@
const struct mapistore_backend *backend = _backend;
uint32_t i;
+ /* Sanity checks */
+ if (!backend) {
+ return MAPISTORE_ERR_INVALID_PARAMETER;
+ }
+
for (i = 0; i < num_backends; i++) {
if (backends[i].backend && backend &&
backend->name && backends[i].backend->name &&
@@ -271,7 +276,7 @@
{
struct backend_context *context;
int retval;
- bool found;
+ bool found = false;
void *private_data = NULL;
int i;
Modified: trunk/openchange/mapiproxy/libmapistore/mapistore_processing.c
===================================================================
--- trunk/openchange/mapiproxy/libmapistore/mapistore_processing.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/mapiproxy/libmapistore/mapistore_processing.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -74,6 +74,11 @@
}
/* Step 2. TODO: Check for write permissions */
+
+ if (!closedir(dir) == -1) {
+ /* FIXME: Should have a better error name here */
+ return MAPISTORE_ERR_NO_DIRECTORY;
+ }
mem_ctx = talloc_autofree_context();
mapping_path = talloc_strdup(mem_ctx, path);
Modified: trunk/openchange/mapiproxy/libmapistore/mapistore_tdb_wrap.c
===================================================================
--- trunk/openchange/mapiproxy/libmapistore/mapistore_tdb_wrap.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/mapiproxy/libmapistore/mapistore_tdb_wrap.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -19,6 +19,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "config.h"
#include <stdio.h>
#include <string.h>
Modified: trunk/openchange/mapiproxy/modules/mpm_cache.c
===================================================================
--- trunk/openchange/mapiproxy/modules/mpm_cache.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/mapiproxy/modules/mpm_cache.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -181,7 +181,12 @@
return NT_STATUS_INVALID_PARAMETER;
}
- stat(stream->filename, &sb);
+ ret = stat(stream->filename, &sb);
+ if (ret == -1) {
+ perror("stat: ");
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
if (sb.st_size != stream->StreamSize) {
DEBUG(0, ("Sync'd file size is 0x%x and 0x%x was expected\n",
(uint32_t)sb.st_size, stream->StreamSize));
Modified: trunk/openchange/ndr_mapi.c
===================================================================
--- trunk/openchange/ndr_mapi.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/ndr_mapi.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -3,7 +3,7 @@
libndr mapi support
- Copyright (C) Julien Kerihuel 2005-2008
+ Copyright (C) Julien Kerihuel 2005-2009
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,6 +33,284 @@
}
}
+ssize_t lzxpress_decompress(const uint8_t *input,
+ uint32_t input_size,
+ uint8_t *output,
+ uint32_t max_output_size);
+
+static enum ndr_err_code ndr_pull_lxpress_chunk(struct ndr_pull *ndrpull,
+ struct ndr_push *ndrpush,
+ ssize_t decompressed_len)
+{
+ DATA_BLOB comp_chunk;
+ DATA_BLOB plain_chunk;
+ int ret;
+
+ /* Step 1. Retrieve the compressed buf */
+ comp_chunk.length = ndrpull->data_size;
+ comp_chunk.data = ndrpull->data;
+
+ plain_chunk.length = decompressed_len;
+ plain_chunk.data = ndrpush->data;
+
+ ret = lzxpress_decompress(comp_chunk.data,
+ comp_chunk.length,
+ plain_chunk.data,
+ plain_chunk.length);
+ if (ret < 0) {
+ return ndr_pull_error(ndrpull, NDR_ERR_COMPRESSION,
+ "XPRESS lzxpress_decompress() returned %d\n",
+ (int)ret);
+ }
+ plain_chunk.length = ret;
+ ndrpush->offset = ret;
+
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_lzxpress_decompress(struct ndr_pull *subndr,
+ struct ndr_pull **_comndr,
+ ssize_t decompressed_len)
+{
+ struct ndr_push *ndrpush;
+ struct ndr_pull *comndr;
+ DATA_BLOB uncompressed;
+
+ ndrpush = ndr_push_init_ctx(subndr, subndr->iconv_convenience);
+ NDR_ERR_HAVE_NO_MEMORY(ndrpush);
+
+ NDR_CHECK(ndr_pull_lxpress_chunk(subndr, ndrpush, decompressed_len));
+
+ uncompressed = ndr_push_blob(ndrpush);
+ if (uncompressed.length != decompressed_len) {
+ return ndr_pull_error(subndr, NDR_ERR_COMPRESSION,
+ "Bad uncompressed_len [%u] != [%u](0x%08X) (PULL)",
+ (int)uncompressed.length,
+ (int)decompressed_len,
+ (int)decompressed_len);
+ }
+
+ comndr = talloc_zero(subndr, struct ndr_pull);
+ NDR_ERR_HAVE_NO_MEMORY(comndr);
+ comndr->flags = subndr->flags;
+ comndr->current_mem_ctx = subndr->current_mem_ctx;
+ comndr->data = uncompressed.data;
+ comndr->data_size = uncompressed.length;
+ comndr->offset = 0;
+
+ comndr->iconv_convenience = talloc_reference(comndr, subndr->iconv_convenience);
+ *_comndr = comndr;
+ return NDR_ERR_SUCCESS;
+}
+
+
+_PUBLIC_ enum ndr_err_code ndr_pull_mapi2k7_request(struct ndr_pull *ndr, int ndr_flags, struct mapi2k7_request *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_RPC_HEADER_EXT(ndr, NDR_SCALARS, &r->header));
+ {
+ uint32_t _flags_save_mapi_request = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_NOALIGN);
+ {
+ struct ndr_pull *_ndr_buffer;
+
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->mapi_request);
+ }
+
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_buffer, 0, -1));
+ {
+ if (r->header.Flags & RHEF_Compressed) {
+ struct ndr_pull *_ndr_data_compressed = NULL;
+
+ NDR_CHECK(ndr_pull_lzxpress_decompress(_ndr_buffer, &_ndr_data_compressed, r->header.SizeActual));
+ NDR_CHECK(ndr_pull_mapi_request(_ndr_data_compressed, NDR_SCALARS|NDR_BUFFERS, r->mapi_request));
+ } else if (r->header.Flags & RHEF_XorMagic) {
+ obfuscate_data(_ndr_buffer->data, _ndr_buffer->data_size, 0xA5);
+ NDR_CHECK(ndr_pull_mapi_request(_ndr_buffer, NDR_SCALARS|NDR_BUFFERS, r->mapi_request));
+ }
+ }
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 0, -1));
+ }
+ ndr->flags = _flags_save_mapi_request;
+ }
+ }
+
+ return NDR_ERR_SUCCESS;
+}
+
+
+_PUBLIC_ enum ndr_err_code ndr_pull_mapi2k7_response(struct ndr_pull *ndr, int ndr_flags, struct mapi2k7_response *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_RPC_HEADER_EXT(ndr, NDR_SCALARS, &r->header));
+ {
+ uint32_t _flags_save_mapi_response = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_REMAINING);
+ {
+ struct ndr_pull *_ndr_buffer;
+
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->mapi_response);
+ }
+
+ NDR_CHECK((ndr_pull_subcontext_start(ndr, &_ndr_buffer, 0, -1)));
+ {
+ if (r->header.Flags & RHEF_Compressed) {
+ struct ndr_pull *_ndr_data_compressed = NULL;
+
+ NDR_CHECK(ndr_pull_lzxpress_decompress(_ndr_buffer, &_ndr_data_compressed, r->header.SizeActual));
+ NDR_CHECK(ndr_pull_mapi_response(_ndr_data_compressed, NDR_SCALARS|NDR_BUFFERS, r->mapi_response));
+ } else if (r->header.Flags & RHEF_XorMagic) {
+ obfuscate_data(_ndr_buffer->data, _ndr_buffer->data_size, 0xA5);
+ NDR_CHECK(ndr_pull_mapi_response(_ndr_buffer, NDR_SCALARS|NDR_BUFFERS, r->mapi_response));
+ }
+ }
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 0, -1));
+ }
+ ndr->flags = _flags_save_mapi_response;
+ }
+ }
+
+ return NDR_ERR_SUCCESS;
+}
+
+
+_PUBLIC_ void ndr_print_AUX_HEADER(struct ndr_print *ndr, const char *name, const struct AUX_HEADER *r)
+{
+ ndr_print_struct(ndr, name, "AUX_HEADER");
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
+ ndr->depth++;
+ ndr_print_uint16(ndr, "Size", r->Size);
+ ndr_print_AUX_VERSION(ndr, "Version", r->Version);
+
+ switch (r->Version) {
+ case AUX_VERSION_1:
+ ndr_print_AUX_HEADER_TYPE_1(ndr, "Type", (enum AUX_HEADER_TYPE_1) r->Type);
+ ndr_print_set_switch_value(ndr, &r->Payload_1, r->Type);
+ ndr_print_AUX_HEADER_TYPE_UNION_1(ndr, "Payload", &r->Payload_1);
+ break;
+ case AUX_VERSION_2:
+ ndr_print_AUX_HEADER_TYPE_2(ndr, "Type", (enum AUX_HEADER_TYPE_2) r->Type);
+ ndr_print_set_switch_value(ndr, &r->Payload_2, r->Type);
+ ndr_print_AUX_HEADER_TYPE_UNION_2(ndr, "Payload", &r->Payload_2);
+ }
+ ndr->depth--;
+ ndr->flags = _flags_save_STRUCT;
+ }
+}
+
+
+_PUBLIC_ enum ndr_err_code ndr_pull_AUX_HEADER(struct ndr_pull *ndr, int ndr_flags, struct AUX_HEADER *r)
+{
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Size));
+ NDR_CHECK(ndr_pull_AUX_VERSION(ndr, NDR_SCALARS, &r->Version));
+ NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Type));
+ switch (r->Version) {
+ case AUX_VERSION_1:
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Payload_1, r->Type));
+ NDR_CHECK(ndr_pull_AUX_HEADER_TYPE_UNION_1(ndr, NDR_SCALARS, &r->Payload_1));
+ break;
+ case AUX_VERSION_2:
+ NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Payload_2, r->Type));
+ NDR_CHECK(ndr_pull_AUX_HEADER_TYPE_UNION_2(ndr, NDR_SCALARS, &r->Payload_2));
+ break;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ ndr->flags = _flags_save_STRUCT;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+
+_PUBLIC_ void ndr_print_mapi2k7_AuxInfo(struct ndr_print *ndr, const char *name, const struct mapi2k7_AuxInfo *r)
+{
+ uint32_t i;
+
+ if (r && r->AUX_HEADER) {
+ ndr_print_struct(ndr, name, "mapi2k7_AuxInfo");
+ ndr->depth++;
+ ndr_print_RPC_HEADER_EXT(ndr, "RPC_HEADER_EXT", &r->RPC_HEADER_EXT);
+ for (i = 0; r->AUX_HEADER[i].Size; i++) {
+ ndr_print_AUX_HEADER(ndr, "AUX_HEADER", &r->AUX_HEADER[i]);
+ }
+ ndr->depth--;
+ } else {
+ ndr_print_pointer(ndr, "mapi2k7_AuxInfo", NULL);
+ }
+}
+
+
+_PUBLIC_ enum ndr_err_code ndr_pull_mapi2k7_AuxInfo(struct ndr_pull *ndr, int ndr_flags, struct mapi2k7_AuxInfo *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+
+ /* Sanity Checks */
+ if (!ndr->data_size) {
+ r->AUX_HEADER = NULL;
+ return NDR_ERR_SUCCESS;
+ }
+
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_RPC_HEADER_EXT(ndr, NDR_SCALARS, &r->RPC_HEADER_EXT));
+ {
+ uint32_t _flags_save_DATA_BLOB = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_REMAINING);
+ if (r->RPC_HEADER_EXT.Size) {
+ struct ndr_pull *_ndr_buffer;
+ TALLOC_CTX *_mem_save_AUX_HEADER_0;
+ uint32_t cntr_AUX_HEADER_0 = 0;
+
+ _mem_save_AUX_HEADER_0 = NDR_PULL_GET_MEM_CTX(ndr);
+
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_buffer, 0, r->RPC_HEADER_EXT.Size));
+ {
+ r->AUX_HEADER = talloc_array(_mem_save_AUX_HEADER_0, struct AUX_HEADER, 2);
+
+ if (r->RPC_HEADER_EXT.Flags & RHEF_Compressed) {
+ struct ndr_pull *_ndr_data_compressed = NULL;
+
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
+ NDR_CHECK(ndr_pull_lzxpress_decompress(_ndr_buffer, &_ndr_data_compressed, r->RPC_HEADER_EXT.SizeActual));
+
+ for (cntr_AUX_HEADER_0 = 0; _ndr_data_compressed->offset < _ndr_data_compressed->data_size; cntr_AUX_HEADER_0++) {
+ NDR_CHECK(ndr_pull_AUX_HEADER(_ndr_data_compressed, NDR_SCALARS, &r->AUX_HEADER[cntr_AUX_HEADER_0]));
+ r->AUX_HEADER = talloc_realloc(_mem_save_AUX_HEADER_0, r->AUX_HEADER, struct AUX_HEADER, cntr_AUX_HEADER_0 + 2);
+ }
+ r->AUX_HEADER = talloc_realloc(_mem_save_AUX_HEADER_0, r->AUX_HEADER, struct AUX_HEADER, cntr_AUX_HEADER_0 + 2);
+ r->AUX_HEADER[cntr_AUX_HEADER_0].Size = 0;
+
+ } else if (r->RPC_HEADER_EXT.Flags & RHEF_XorMagic) {
+ obfuscate_data(_ndr_buffer->data, _ndr_buffer->data_size, 0xA5);
+
+ for (cntr_AUX_HEADER_0 = 0; _ndr_buffer->offset < _ndr_buffer->data_size; cntr_AUX_HEADER_0++) {
+ NDR_CHECK(ndr_pull_AUX_HEADER(_ndr_buffer, NDR_SCALARS, &r->AUX_HEADER[cntr_AUX_HEADER_0]));
+ r->AUX_HEADER = talloc_realloc(_mem_save_AUX_HEADER_0, r->AUX_HEADER, struct AUX_HEADER, cntr_AUX_HEADER_0 + 2);
+ }
+ r->AUX_HEADER = talloc_realloc(_mem_save_AUX_HEADER_0, r->AUX_HEADER, struct AUX_HEADER, cntr_AUX_HEADER_0 + 2);
+ r->AUX_HEADER[cntr_AUX_HEADER_0].Size = 0;
+ }
+ }
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_buffer, 0, -1));
+ }
+ ndr->flags = _flags_save_DATA_BLOB;
+ }
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
/*
print mapi_request / mapi_response structures
*/
@@ -134,8 +412,6 @@
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->handles[cntr_mapi_req_0]));
}
- obfuscate_data(ndr->data, ndr->offset, 0xA5);
-
return NDR_ERR_SUCCESS;
}
@@ -158,8 +434,6 @@
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->handles[cntr_mapi_repl_0]));
}
- obfuscate_data(ndr->data, ndr->alloc_size, 0xA5);
-
return NDR_ERR_SUCCESS;
}
@@ -175,8 +449,6 @@
TALLOC_CTX *_mem_save_handles_0;
struct ndr_pull *_ndr_mapi_req;
- obfuscate_data(ndr->data, ndr->data_size, 0xA5);
-
if (ndr->flags & LIBNDR_FLAG_REMAINING) {
length = ndr->data_size - ndr->offset;
} else {
@@ -224,8 +496,6 @@
TALLOC_CTX *_mem_save_handles_0;
struct ndr_pull *_ndr_mapi_repl;
- obfuscate_data(ndr->data, ndr->data_size, 0xA5);
-
if (ndr->flags & LIBNDR_FLAG_REMAINING) {
length = ndr->data_size - ndr->offset;
} else {
@@ -376,6 +646,163 @@
}
}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_EcDoRpc(struct ndr_pull *ndr, int flags, struct EcDoRpc *r)
+{
+ TALLOC_CTX *_mem_save_handle_0;
+ TALLOC_CTX *_mem_save_mapi_request_0;
+ TALLOC_CTX *_mem_save_mapi_response_0;
+ TALLOC_CTX *_mem_save_length_0;
+
+ if (flags & NDR_IN) {
+ ZERO_STRUCT(r->out);
+
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.handle);
+ }
+ _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.size));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offset));
+ {
+ uint32_t _flags_save_mapi_request = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_NOALIGN);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.mapi_request);
+ }
+ _mem_save_mapi_request_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.mapi_request, LIBNDR_FLAG_REF_ALLOC);
+ {
+ struct ndr_pull *_ndr_mapi_request;
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_mapi_request, 4, -1));
+ obfuscate_data(_ndr_mapi_request->data, _ndr_mapi_request->data_size, 0xA5);
+ NDR_CHECK(ndr_pull_mapi_request(_ndr_mapi_request, NDR_SCALARS|NDR_BUFFERS, r->in.mapi_request));
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_mapi_request, 4, -1));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mapi_request_0, LIBNDR_FLAG_REF_ALLOC);
+ ndr->flags = _flags_save_mapi_request;
+ }
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->in.length);
+ }
+ _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.length, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.length));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.max_data));
+ NDR_PULL_ALLOC(ndr, r->out.handle);
+ *r->out.handle = *r->in.handle;
+ NDR_PULL_ALLOC(ndr, r->out.mapi_response);
+ ZERO_STRUCTP(r->out.mapi_response);
+ NDR_PULL_ALLOC(ndr, r->out.length);
+ *r->out.length = *r->in.length;
+ }
+ if (flags & NDR_OUT) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.handle);
+ }
+ _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.size));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.offset));
+ {
+ uint32_t _flags_save_mapi_response = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_NOALIGN);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.mapi_response);
+ }
+ _mem_save_mapi_response_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.mapi_response, LIBNDR_FLAG_REF_ALLOC);
+ {
+ struct ndr_pull *_ndr_mapi_response;
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_mapi_response, 4, -1));
+ obfuscate_data(_ndr_mapi_response->data, _ndr_mapi_response->data_size, 0xA5);
+ NDR_CHECK(ndr_pull_mapi_response(_ndr_mapi_response, NDR_SCALARS|NDR_BUFFERS, r->out.mapi_response));
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_mapi_response, 4, -1));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mapi_response_0, LIBNDR_FLAG_REF_ALLOC);
+ ndr->flags = _flags_save_mapi_response;
+ }
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.length);
+ }
+ _mem_save_length_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.length, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.length));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_length_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_MAPISTATUS(ndr, NDR_SCALARS, &r->out.result));
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+
+_PUBLIC_ enum ndr_err_code ndr_push_EcDoRpc(struct ndr_push *ndr, int flags, const struct EcDoRpc *r)
+{
+ if (flags & NDR_IN) {
+ if (r->in.handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.size));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offset));
+ {
+ uint32_t _flags_save_mapi_request = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_NOALIGN);
+ if (r->in.mapi_request == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ {
+ struct ndr_push *_ndr_mapi_request;
+ NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_mapi_request, 4, -1));
+ NDR_CHECK(ndr_push_mapi_request(_ndr_mapi_request, NDR_SCALARS|NDR_BUFFERS, r->in.mapi_request));
+ obfuscate_data(_ndr_mapi_request->data, _ndr_mapi_request->offset, 0xA5);
+ NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_mapi_request, 4, -1));
+ }
+ ndr->flags = _flags_save_mapi_request;
+ }
+ if (r->in.length == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.length));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.max_data));
+ }
+ if (flags & NDR_OUT) {
+ if (r->out.handle == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.handle));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.size));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.offset));
+ {
+ uint32_t _flags_save_mapi_response = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_NOALIGN);
+ if (r->out.mapi_response == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ {
+ struct ndr_push *_ndr_mapi_response;
+ NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_mapi_response, 4, -1));
+ NDR_CHECK(ndr_push_mapi_response(_ndr_mapi_response, NDR_SCALARS|NDR_BUFFERS, r->out.mapi_response));
+ obfuscate_data(_ndr_mapi_response->data, _ndr_mapi_response->alloc_size, 0xA5);
+ NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_mapi_response, 4, -1));
+ }
+ ndr->flags = _flags_save_mapi_response;
+ }
+ if (r->out.length == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->out.length));
+ NDR_CHECK(ndr_push_MAPISTATUS(ndr, NDR_SCALARS, r->out.result));
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+
+
/*
We need to pull QueryRows replies on our own:
If we have no results, do not push/pull the DATA_BLOB
@@ -422,6 +849,9 @@
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->RowData));
ndr->flags = _flags_save_DATA_BLOB;
+ } else {
+ r->RowData.length = 0;
+ r->RowData.data = NULL;
}
}
if (ndr_flags & NDR_BUFFERS) {
Modified: trunk/openchange/torture/mapi_permissions.c
===================================================================
--- trunk/openchange/torture/mapi_permissions.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/torture/mapi_permissions.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -115,7 +115,7 @@
uint32_t *rights;
lpProp = get_SPropValue_SRow(&(SRowSet.aRow[i]), PR_MEMBER_NAME);
- printf(" %-25s: %s\n", "Username", lpProp->value.lpszA ? lpProp->value.lpszA : "Default");
+ printf(" %-25s: %s\n", "Username", lpProp && lpProp->value.lpszA ? lpProp->value.lpszA : "Default");
lpProp = get_SPropValue_SRow(&(SRowSet.aRow[i]), PR_MEMBER_RIGHTS);
rights = &(lpProp->value.l);
ndr_print_debug((ndr_print_fn_t)ndr_print_ACLRIGHTS, "Rights", (void *)rights);
Modified: trunk/openchange/torture/mapi_sendattach.c
===================================================================
--- trunk/openchange/torture/mapi_sendattach.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/torture/mapi_sendattach.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -185,7 +185,7 @@
{
int fd;
struct stat sb;
- uint32_t read_size;
+ ssize_t read_size;
uint16_t buf_readsize;
uint8_t buf[0x7000];
@@ -196,11 +196,13 @@
return false;
}
- while ((read_size = read(fd, buf, 0x4000))) {
+ while (((read_size = read(fd, buf, 0x4000)) != -1) && read_size) {
/* We reset errno due to read */
blob.length = read_size;
blob.data = talloc_size(mem_ctx, read_size);
- memcpy(blob.data, buf, read_size);
+ if (read_size > 0) {
+ memcpy(blob.data, buf, read_size);
+ }
errno = 0;
retval = WriteStream(&obj_stream, &blob, &buf_readsize);
Modified: trunk/openchange/torture/nspi_resolvenames.c
===================================================================
--- trunk/openchange/torture/nspi_resolvenames.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/torture/nspi_resolvenames.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -34,7 +34,7 @@
enum MAPISTATUS retval;
struct dcerpc_pipe *p;
TALLOC_CTX *mem_ctx;
- struct mapi_session *session;
+ struct mapi_session *session = NULL;
bool ret = true;
struct SPropTagArray *SPropTagArray;
struct SRowSet *rowset = NULL;
Modified: trunk/openchange/utils/exchange2mbox.c
===================================================================
--- trunk/openchange/utils/exchange2mbox.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/utils/exchange2mbox.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -782,7 +782,9 @@
PR_HASATTACH);
retval = GetProps(&obj_message, SPropTagArray, &lpProps, &count);
MAPIFreeBuffer(SPropTagArray);
- if (retval != MAPI_E_SUCCESS) return false;
+ if (retval != MAPI_E_SUCCESS) {
+ exit (1);
+ }
/* Build a SRow structure */
aRow.ulAdrEntryPad = 0;
Modified: trunk/openchange/utils/mapitest/modules/module_oxcfold.c
===================================================================
--- trunk/openchange/utils/mapitest/modules/module_oxcfold.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/utils/mapitest/modules/module_oxcfold.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -658,7 +658,7 @@
return false;
}
mapi_object_init(&(dst_contents));
- GetContentsTable(&(obj_folder_dst), &(dst_contents), 0, &dst_count);
+ retval = GetContentsTable(&(obj_folder_dst), &(dst_contents), 0, &dst_count);
mapitest_print_retval(mt, "GetContentsTable");
if (GetLastError() != MAPI_E_SUCCESS) {
ret = false;
@@ -980,6 +980,8 @@
/* Step 1. Logon */
mapi_object_init(&obj_store);
+ mapi_object_init(&obj_folder);
+
retval = OpenMsgStore(mt->session, &obj_store);
mapitest_print_retval(mt, "OpenMsgStore");
if (retval != MAPI_E_SUCCESS) {
@@ -988,7 +990,6 @@
}
/* Step 2. Open Source Inbox folder */
- mapi_object_init(&obj_folder);
retval = GetDefaultFolder(&obj_store, &id_folder, olFolderInbox);
mapitest_print_retval(mt, "GetDefaultFolder");
if (retval != MAPI_E_SUCCESS) {
Modified: trunk/openchange/utils/mapitest/modules/module_oxcprpt.c
===================================================================
--- trunk/openchange/utils/mapitest/modules/module_oxcprpt.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/utils/mapitest/modules/module_oxcprpt.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -317,7 +317,7 @@
mapi_object_init(&obj_ref_message);
result = mapitest_common_message_create(mt, &obj_ref_folder, &obj_ref_message, MT_MAIL_SUBJECT);
mapitest_print_retval_step_fmt(mt, "3.1.", "mapitest_common_message_create", "(%s)", "Create a reference email");
- if (!result != MAPI_E_SUCCESS) {
+ if (result != true) {
return false;
}
retval = SaveChangesMessage(&obj_ref_folder, &obj_ref_message, KeepOpenReadWrite);
@@ -464,7 +464,7 @@
mapi_object_init(&obj_ref_message);
result = mapitest_common_message_create(mt, &obj_ref_folder, &obj_ref_message, MT_MAIL_SUBJECT);
mapitest_print_retval_step_fmt(mt, "3.1.", "mapitest_common_message_create", "(%s)", "Create a reference email");
- if (!result) {
+ if (result != true) {
return false;
}
retval = SaveChangesMessage(&obj_ref_folder, &obj_ref_message, KeepOpenReadWrite);
@@ -509,7 +509,7 @@
mapi_object_init(&obj_target_message);
result = mapitest_common_message_create(mt, &obj_ref_folder, &obj_target_message, MT_MAIL_SUBJECT);
mapitest_print_retval_step_fmt(mt, "5.1.", "mapitest_common_message_create", "(%s)", "Create target email");
- if (!result) {
+ if (result != true) {
return false;
}
retval = SaveChangesMessage(&obj_ref_folder, &obj_target_message, KeepOpenReadWrite);
@@ -848,7 +848,11 @@
/* Step 3. Create the message */
mapi_object_init(&obj_message);
- mapitest_common_message_create(mt, &obj_folder, &obj_message, MT_MAIL_SUBJECT);
+ ret = mapitest_common_message_create(mt, &obj_folder, &obj_message, MT_MAIL_SUBJECT);
+ mapitest_print_retval(mt, "Message Creation");
+ if (ret != true) {
+ return false;
+ }
/* Step 4. Create the attachment */
mapi_object_init(&obj_attach);
@@ -1141,7 +1145,11 @@
/* Step 3. Create the message */
mapi_object_init(&obj_message);
- mapitest_common_message_create(mt, &obj_folder, &obj_message, MT_MAIL_SUBJECT);
+ ret = mapitest_common_message_create(mt, &obj_folder, &obj_message, MT_MAIL_SUBJECT);
+ mapitest_print_retval(mt, "Message Creation");
+ if (ret != true) {
+ return false;
+ }
/* Step 4. Create the first attachment */
mapi_object_init(&obj_attach);
@@ -1410,12 +1418,17 @@
/* Step 1. Logon Private Mailbox */
mapi_object_init(&obj_store);
+ mapi_object_init(&obj_top_folder);
+ mapi_object_init(&obj_ref_folder);
+ mapi_object_init(&obj_ref_message);
+ mapi_object_init(&obj_target_message);
+ mapi_object_init(&obj_targ_attach);
+
retval = OpenMsgStore(mt->session, &obj_store);
mapitest_print_retval(mt, "OpenMsgStore");
if (retval != MAPI_E_SUCCESS) {
return false;
}
- mapi_object_init(&obj_top_folder);
retval = GetDefaultFolder(&obj_store, &id_top_folder, olFolderTopInformationStore);
mapitest_print_retval(mt, "GetDefaultFolder");
@@ -1427,7 +1440,6 @@
}
/* Step 2: Create reference folder */
- mapi_object_init(&obj_ref_folder);
retval = CreateFolder(&obj_top_folder, FOLDER_GENERIC, MT_DIRNAME_TOP, NULL,
OPEN_IF_EXISTS, &obj_ref_folder);
mapitest_print_retval_fmt(mt, "CreateFolder", "(Create test folder)");
@@ -1445,10 +1457,9 @@
}
/* Step 3: Create reference message */
- mapi_object_init(&obj_ref_message);
result = mapitest_common_message_create(mt, &obj_ref_folder, &obj_ref_message, MT_MAIL_SUBJECT);
mapitest_print_retval(mt, "mapitest_common_message_create");
- if (!result) {
+ if (result != true) {
ret = false;
goto cleanup;
}
@@ -1512,10 +1523,9 @@
}
/* Step 5: Create target message */
- mapi_object_init(&obj_target_message);
result = mapitest_common_message_create(mt, &obj_ref_folder, &obj_target_message, MT_MAIL_SUBJECT);
mapitest_print_retval(mt, "mapitest_common_message_create");
- if (!result) {
+ if (result != true) {
ret = false;
goto cleanup;
}
@@ -1806,7 +1816,6 @@
mapitest_print_retval(mt, "SaveChangesAttachment");
/* Step 14: Create attachment on target email */
- mapi_object_init(&obj_targ_attach);
retval = CreateAttach(&obj_target_message, &obj_targ_attach);
mapitest_print_retval(mt, "CreateAttach");
if (retval != MAPI_E_SUCCESS) {
@@ -2039,12 +2048,16 @@
/* Log into the server */
mapi_object_init(&obj_store);
+ mapi_object_init(&obj_top_folder);
+ mapi_object_init(&obj_ref_folder);
+ mapi_object_init(&obj_ref_message);
+
retval = OpenMsgStore(mt->session, &obj_store);
mapitest_print_retval(mt, "OpenMsgStore");
if (retval != MAPI_E_SUCCESS) {
return false;
}
- mapi_object_init(&obj_top_folder);
+
retval = GetDefaultFolder(&obj_store, &id_top_folder, olFolderTopInformationStore);
mapitest_print_retval(mt, "GetDefaultFolder");
if (retval != MAPI_E_SUCCESS) {
@@ -2060,7 +2073,6 @@
}
/* Step 2: Create test folder */
- mapi_object_init(&obj_ref_folder);
CreateFolder(&obj_top_folder, FOLDER_GENERIC, MT_DIRNAME_TOP, NULL,
OPEN_IF_EXISTS, &obj_ref_folder);
mapitest_print_retval(mt, "CreateFolder");
@@ -2069,10 +2081,9 @@
goto cleanup;
}
- mapi_object_init(&obj_ref_message);
result = mapitest_common_message_create(mt, &obj_ref_folder, &obj_ref_message, MT_MAIL_SUBJECT);
mapitest_print_retval(mt, "mapitest_common_message_create");
- if (!result) {
+ if (result != true) {
ret = false;
goto cleanup;
}
@@ -2493,7 +2504,11 @@
/* Step 3. Create the message */
mapi_object_init(&obj_message);
- mapitest_common_message_create(mt, &obj_folder, &obj_message, MT_MAIL_SUBJECT);
+ ret = mapitest_common_message_create(mt, &obj_folder, &obj_message, MT_MAIL_SUBJECT);
+ mapitest_print_retval(mt, "Message Creation");
+ if (ret != true) {
+ return false;
+ }
/* Step 4. Create the attachment */
mapi_object_init(&obj_attach);
Modified: trunk/openchange/utils/mapitest/modules/module_oxomsg.c
===================================================================
--- trunk/openchange/utils/mapitest/modules/module_oxomsg.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/utils/mapitest/modules/module_oxomsg.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -143,6 +143,9 @@
mapitest_common_message_delete_by_subject(mt, &obj_folder, MT_MAIL_SUBJECT);
GetDefaultFolder(&obj_store, &id_folder, olFolderInbox);
OpenFolder(&obj_store, id_folder, &obj_folder);
+ if (GetLastError() != MAPI_E_SUCCESS) {
+ return false;
+ }
mapitest_common_message_delete_by_subject(mt, &obj_folder, MT_MAIL_SUBJECT);
/* Release */
@@ -244,7 +247,11 @@
mapitest_common_message_delete_by_subject(mt, &obj_folder, MT_MAIL_SUBJECT);
GetDefaultFolder(&obj_store, &id_folder, olFolderInbox);
OpenFolder(&obj_store, id_folder, &obj_folder);
- mapitest_common_message_delete_by_subject(mt, &obj_folder, MT_MAIL_SUBJECT);
+ if (GetLastError() != MAPI_E_SUCCESS) {
+ ret = false;
+ } else {
+ mapitest_common_message_delete_by_subject(mt, &obj_folder, MT_MAIL_SUBJECT);
+ }
/* Release */
mapi_object_release(&obj_message);
@@ -449,6 +456,7 @@
uint32_t i;
struct SPropValue lpProp;
+ lpProp.dwAlignPad = 0;
for (i = 0; i < lpProps.cValues; i++) {
cast_SPropValue(&lpProps.lpProps[i], &lpProp);
mapidump_SPropValue(lpProp, "\t* ");
@@ -460,7 +468,11 @@
mapitest_common_message_delete_by_subject(mt, &obj_folder, MT_MAIL_SUBJECT);
GetDefaultFolder(&obj_store, &id_folder, olFolderInbox);
OpenFolder(&obj_store, id_folder, &obj_folder);
- mapitest_common_message_delete_by_subject(mt, &obj_folder, MT_MAIL_SUBJECT);
+ if (GetLastError() != MAPI_E_SUCCESS) {
+ ret = false;
+ } else {
+ mapitest_common_message_delete_by_subject(mt, &obj_folder, MT_MAIL_SUBJECT);
+ }
/* Release */
mapi_object_release(&obj_message);
Modified: trunk/openchange/utils/mapitest/modules/module_oxorule.c
===================================================================
--- trunk/openchange/utils/mapitest/modules/module_oxorule.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/utils/mapitest/modules/module_oxorule.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -52,6 +52,9 @@
/* Step 1. Logon */
mapi_object_init(&obj_store);
+ mapi_object_init(&obj_folder);
+ mapi_object_init(&obj_rtable);
+
retval = OpenMsgStore(mt->session, &obj_store);
if (retval != MAPI_E_SUCCESS) {
ret = false;
@@ -59,14 +62,12 @@
}
/* Step 2. Open the Inbox folder */
- mapi_object_init(&obj_folder);
ret = mapitest_common_folder_open(mt, &obj_store, &obj_folder, olFolderInbox);
if (ret == false) {
goto cleanup;
}
/* Step 3. Retrieve the rules table */
- mapi_object_init(&obj_rtable);
retval = GetRulesTable(&obj_folder, &obj_rtable, RulesTableFlags_Unicode);
mapitest_print_retval(mt, "GetRulesTable");
if (retval != MAPI_E_SUCCESS) {
Modified: trunk/openchange/utils/openchangeclient.c
===================================================================
--- trunk/openchange/utils/openchangeclient.c 2009-06-12 14:19:47 UTC (rev 2844)
+++ trunk/openchange/utils/openchangeclient.c 2009-06-12 20:26:28 UTC (rev 2845)
@@ -507,7 +507,7 @@
printf("[%u] %s (%u Bytes)\n", j, attach_filename, attach_size ? *attach_size : 0);
fflush(0);
if (oclient->store_folder) {
- status = store_attachment(obj_attach, attach_filename, *attach_size, oclient);
+ status = store_attachment(obj_attach, attach_filename, attach_size ? *attach_size : 0, oclient);
if (status == false) {
printf("A Problem was encountered while storing attachments on the filesystem\n");
MAPI_RETVAL_IF(status == false, MAPI_E_UNABLE_TO_COMPLETE, mem_ctx);
More information about the Pkg-samba-maint
mailing list