Hi List, Attached is a patch which fixes openchange build against samba4-alpha3 git 41309dc.
I have run the following tests:
* mapiprofile
* torture openchange-nspi-profile
* torture openchange-nspi-resolvenames
* openchangeclient --userlist
* mapitest mapi-all and mapi-calls
Everything works fine for me, but I'd like to have feedback from other
developers/users before I apply.
Please note that this patch is not retroactive and if/once applied to
the trunk, it will break any openchange installation based upon samba4
svn rev <= rev26701.
You'll find below the instructions to compile/install this Samba4-git
revision:
=============
git-clone git://git.samba.org/samba.git samba4
cd samba4
git checkout -b openchange origin/v4-0-test
git reset --hard 41309dc
./autogen.sh && ./configure && make && sudo make install
/sbin/ldconfig
cd pidl && perl Makefile.PL && make && sudo make install
=============
Furthermore a samba4 installation script will be added to the trunk
tonight, so developers can work on the same version and we don't
encounter anymore potential problem with Samba4 installation and/or pidl
version.
Cheers,
Julien.
--
Julien Kerihuel
[EMAIL PROTECTED]
OpenChange Project Manager
GPG Fingerprint: 0B55 783D A781 6329 108A B609 7EF6 FE11 A35F 1F79
Index: utils/openchangeclient.c
===================================================================
--- utils/openchangeclient.c (revision 388)
+++ utils/openchangeclient.c (working copy)
@@ -2342,7 +2342,6 @@
do {
count += 0x2;
retval = GetGALTable(SPropTagArray, &SRowSet, count, ulFlags);
- printf("SRoSet->cRows = %d\n", SRowSet->cRows);
if (SRowSet->cRows) {
for (i = 0; i < SRowSet->cRows; i++) {
mapidump_PAB_entry(&SRowSet->aRow[i]);
Index: torture/nspi_profile.c
===================================================================
--- torture/nspi_profile.c (revision 382)
+++ torture/nspi_profile.c (working copy)
@@ -82,7 +82,7 @@
TALLOC_CTX *mem_ctx;
struct nspi_context *nspi;
struct SPropTagArray *SPropTagArray;
- struct SRowSet rowset;
+ struct SRowSet *rowset;
struct SPropValue *lpProp;
const char *profname = lp_parm_string(global_loadparm, NULL, "mapi",
"profile");
@@ -164,11 +164,12 @@
PR_INSTANCE_KEY,
PR_EMAIL_ADDRESS
);
+ rowset = talloc_zero(nspi->mem_ctx, struct SRowSet);
retval = nspi_GetMatches(nspi, SPropTagArray, &rowset, NULL);
mapi_errstr("NspiGetMatches", GetLastError());
if (retval != MAPI_E_SUCCESS) return false;
- lpProp = get_SPropValue_SRowSet(&rowset, PR_INSTANCE_KEY);
+ lpProp = get_SPropValue_SRowSet(rowset, PR_INSTANCE_KEY);
if (lpProp) {
struct SBinary bin;
@@ -178,7 +179,7 @@
nspi->profile_instance_key = 0;
}
- lpProp = get_SPropValue_SRowSet(&rowset, PR_EMAIL_ADDRESS);
+ lpProp = get_SPropValue_SRowSet(rowset, PR_EMAIL_ADDRESS);
if (lpProp) {
DEBUG(3, ("PR_EMAIL_ADDRESS: %s\n", lpProp->value.lpszA));
nspi->org = x500_get_dn_element(nspi->mem_ctx, lpProp->value.lpszA, ORG);
@@ -188,10 +189,10 @@
}
if (profname) {
- set_profile_attribute(profname, rowset, PR_EMAIL_ADDRESS, "EmailAddress");
- set_profile_attribute(profname, rowset, PR_DISPLAY_NAME, "DisplayName");
- set_profile_attribute(profname, rowset, PR_ACCOUNT, "Account");
- set_profile_attribute(profname, rowset, PR_ADDRTYPE, "AddrType");
+ set_profile_attribute(profname, *rowset, PR_EMAIL_ADDRESS, "EmailAddress");
+ set_profile_attribute(profname, *rowset, PR_DISPLAY_NAME, "DisplayName");
+ set_profile_attribute(profname, *rowset, PR_ACCOUNT, "Account");
+ set_profile_attribute(profname, *rowset, PR_ADDRTYPE, "AddrType");
retval = mapi_profile_add_string_attr(profname, "Organization", nspi->org);
retval = mapi_profile_add_string_attr(profname, "OrganizationUnit", nspi->org_unit);
}
@@ -213,13 +214,13 @@
mapi_errstr("NspiQueryRows", GetLastError());
if (retval != MAPI_E_SUCCESS) return false;
- lpProp = get_SPropValue_SRowSet(&rowset, PR_EMS_AB_HOME_MDB);
+ lpProp = get_SPropValue_SRowSet(rowset, PR_EMS_AB_HOME_MDB);
if (lpProp) {
nspi->servername = x500_get_servername(lpProp->value.lpszA);
if (profname) {
mapi_profile_add_string_attr(profname, "ServerName", nspi->servername);
- set_profile_attribute(profname, rowset, PR_EMS_AB_HOME_MDB, "HomeMDB");
- set_profile_mvstr_attribute(profname, rowset, PR_EMS_AB_PROXY_ADDRESSES, "ProxyAddress");
+ set_profile_attribute(profname, *rowset, PR_EMS_AB_HOME_MDB, "HomeMDB");
+ set_profile_mvstr_attribute(profname, *rowset, PR_EMS_AB_PROXY_ADDRESSES, "ProxyAddress");
}
} else {
printf("Unable to find the server name\n");
@@ -238,7 +239,7 @@
if (retval != MAPI_E_SUCCESS) return false;
if (profname) {
- set_profile_mvstr_attribute(profname, rowset, PR_EMS_AB_NETWORK_ADDRESS, "NetworkAddress");
+ set_profile_mvstr_attribute(profname, *rowset, PR_EMS_AB_NETWORK_ADDRESS, "NetworkAddress");
}
retval = nspi_unbind(nspi);
Index: libmapi/IABContainer.c
===================================================================
--- libmapi/IABContainer.c (revision 382)
+++ libmapi/IABContainer.c (working copy)
@@ -113,6 +113,7 @@
uint32_t count, uint8_t ulFlags)
{
struct nspi_context *nspi;
+ struct SRowSet *srowset;
enum MAPISTATUS retval;
mapi_ctx_t *mapi_ctx;
uint32_t instance_key = 0;
@@ -135,8 +136,9 @@
memset(nspi->settings->service_provider.ab + 12, 0xff, 4);
}
- *SRowSet = talloc_zero(mapi_ctx->session, struct SRowSet);
- retval = nspi_QueryRows(nspi, SPropTagArray, *SRowSet, count);
+ srowset = talloc_zero(mapi_ctx->session, struct SRowSet);
+ retval = nspi_QueryRows(nspi, SPropTagArray, &srowset, count);
+ *SRowSet = srowset;
nspi->profile_instance_key = instance_key;
Index: libmapi/nspi.c
===================================================================
--- libmapi/nspi.c (revision 382)
+++ libmapi/nspi.c (working copy)
@@ -179,7 +179,7 @@
*/
_PUBLIC_ enum MAPISTATUS nspi_QueryRows(struct nspi_context *nspi, struct SPropTagArray *SPropTagArray,
- struct SRowSet *rowset, uint32_t count)
+ struct SRowSet **rowset, uint32_t count)
{
struct NspiQueryRows r;
NTSTATUS status;
@@ -210,7 +210,7 @@
settings = talloc(nspi->mem_ctx, struct MAPI_SETTINGS);
r.out.settings = settings;
- r.out.RowSet = &rowset;
+ r.out.RowSet = rowset;
status = dcerpc_NspiQueryRows(nspi->rpc_connection, nspi->mem_ctx, &r);
retval = r.out.result;
@@ -230,7 +230,7 @@
*/
_PUBLIC_ enum MAPISTATUS nspi_GetMatches(struct nspi_context *nspi, struct SPropTagArray *SPropTagArray,
- struct SRowSet *rowset, const char *username)
+ struct SRowSet **rowset, const char *username)
{
struct NspiGetMatches r;
NTSTATUS status;
@@ -283,12 +283,14 @@
instance_key = talloc(nspi->mem_ctx, struct instance_key);
r.out.instance_key = instance_key;
- r.out.RowSet = &rowset;
+ r.out.RowSet = rowset;
status = dcerpc_NspiGetMatches(nspi->rpc_connection, nspi->mem_ctx, &r);
retval = r.out.result;
MAPI_RETVAL_IF(!MAPI_STATUS_IS_OK(NT_STATUS_V(status)), MAPI_E_NOT_FOUND, NULL);
+ rowset = r.out.RowSet;
+
return MAPI_E_SUCCESS;
}
@@ -343,7 +345,7 @@
_PUBLIC_ enum MAPISTATUS nspi_GetProps(struct nspi_context *nspi,
struct SPropTagArray *SPropTagArray,
- struct SRowSet *rowset)
+ struct SRowSet **rowset)
{
struct NspiGetProps r;
NTSTATUS status;
@@ -370,11 +372,11 @@
retval = r.out.result;
MAPI_RETVAL_IF(!MAPI_STATUS_IS_OK(NT_STATUS_V(status)), retval, NULL);
- rowset->cRows = 1;
- rowset->aRow = talloc(nspi->mem_ctx, struct SRow);
- rowset->aRow->ulAdrEntryPad = REPL_values->ulAdrEntryPad;
- rowset->aRow->cValues = REPL_values->cValues;
- rowset->aRow->lpProps = REPL_values->lpProps;
+ rowset[0]->cRows = 1;
+ rowset[0]->aRow = talloc(nspi->mem_ctx, struct SRow);
+ rowset[0]->aRow->ulAdrEntryPad = REPL_values->ulAdrEntryPad;
+ rowset[0]->aRow->cValues = REPL_values->cValues;
+ rowset[0]->aRow->lpProps = REPL_values->lpProps;
return MAPI_E_SUCCESS;
}
@@ -385,7 +387,7 @@
*/
_PUBLIC_ enum MAPISTATUS nspi_GetHierarchyInfo(struct nspi_context *nspi,
- struct SRowSet *rowset)
+ struct SRowSet **rowset)
{
struct NspiGetHierarchyInfo r;
NTSTATUS status;
@@ -409,7 +411,7 @@
r.in.unknown2 = &unknown;
r.out.unknown2 = &unknown;
- r.out.RowSet = &rowset;
+ r.out.RowSet = rowset;
status = dcerpc_NspiGetHierarchyInfo(nspi->rpc_connection, nspi->mem_ctx, &r);
retval = r.out.result;
Index: libmapi/IProfAdmin.c
===================================================================
--- libmapi/IProfAdmin.c (revision 382)
+++ libmapi/IProfAdmin.c (working copy)
@@ -1184,7 +1184,7 @@
enum MAPISTATUS retval;
struct nspi_context *nspi;
struct SPropTagArray *SPropTagArray;
- struct SRowSet rowset;
+ struct SRowSet *rowset;
struct SPropValue *lpProp = NULL;
const char *profname;
uint32_t index = 0;
@@ -1213,19 +1213,21 @@
PR_INSTANCE_KEY,
PR_EMAIL_ADDRESS
);
+
+ rowset = talloc_zero(nspi->mem_ctx, struct SRowSet);
retval = nspi_GetMatches(nspi, SPropTagArray, &rowset, username);
if (retval != MAPI_E_SUCCESS) return retval;
/* if there's no match */
- MAPI_RETVAL_IF(!rowset.cRows, MAPI_E_NOT_FOUND, NULL);
+ MAPI_RETVAL_IF(!rowset->cRows, MAPI_E_NOT_FOUND, NULL);
/* if rowset count is superior than 1 an callback is specified, call it */
- if (rowset.cRows > 1 && callback) {
- index = callback(&rowset, private);
- MAPI_RETVAL_IF((index >= rowset.cRows), MAPI_E_USER_CANCEL, NULL);
+ if (rowset->cRows > 1 && callback) {
+ index = callback(rowset, private);
+ MAPI_RETVAL_IF((index >= rowset->cRows), MAPI_E_USER_CANCEL, NULL);
}
- lpProp = get_SPropValue_SRow(&(rowset.aRow[index]), PR_INSTANCE_KEY);
+ lpProp = get_SPropValue_SRow(&(rowset->aRow[index]), PR_INSTANCE_KEY);
if (lpProp) {
struct SBinary bin;
@@ -1235,10 +1237,10 @@
nspi->profile_instance_key = 0;
}
- set_profile_attribute(profname, rowset, index, PR_EMAIL_ADDRESS, "EmailAddress");
- set_profile_attribute(profname, rowset, index, PR_DISPLAY_NAME, "DisplayName");
- set_profile_attribute(profname, rowset, index, PR_ACCOUNT, "Account");
- set_profile_attribute(profname, rowset, index, PR_ADDRTYPE, "AddrType");
+ set_profile_attribute(profname, *rowset, index, PR_EMAIL_ADDRESS, "EmailAddress");
+ set_profile_attribute(profname, *rowset, index, PR_DISPLAY_NAME, "DisplayName");
+ set_profile_attribute(profname, *rowset, index, PR_ACCOUNT, "Account");
+ set_profile_attribute(profname, *rowset, index, PR_ADDRTYPE, "AddrType");
SPropTagArray = set_SPropTagArray(nspi->mem_ctx, 0x7,
PR_DISPLAY_NAME,
@@ -1256,7 +1258,7 @@
retval = nspi_QueryRows(nspi, SPropTagArray, &rowset, 1);
if (retval != MAPI_E_SUCCESS) return retval;
- lpProp = get_SPropValue_SRowSet(&rowset, PR_EMS_AB_HOME_MDB);
+ lpProp = get_SPropValue_SRowSet(rowset, PR_EMS_AB_HOME_MDB);
MAPI_RETVAL_IF(!lpProp, MAPI_E_NOT_FOUND, NULL);
nspi->org = x500_get_dn_element(nspi->mem_ctx, lpProp->value.lpszA, ORG);
@@ -1270,8 +1272,8 @@
nspi->servername = x500_get_servername(lpProp->value.lpszA);
mapi_profile_add_string_attr(profname, "ServerName", nspi->servername);
- set_profile_attribute(profname, rowset, 0, PR_EMS_AB_HOME_MDB, "HomeMDB");
- set_profile_mvstr_attribute(profname, rowset, 0, PR_EMS_AB_PROXY_ADDRESSES, "ProxyAddress");
+ set_profile_attribute(profname, *rowset, 0, PR_EMS_AB_HOME_MDB, "HomeMDB");
+ set_profile_mvstr_attribute(profname, *rowset, 0, PR_EMS_AB_PROXY_ADDRESSES, "ProxyAddress");
retval = nspi_DNToEph(nspi);
if (retval != MAPI_E_SUCCESS) return retval;
@@ -1279,7 +1281,7 @@
SPropTagArray = set_SPropTagArray(nspi->mem_ctx, 0x1, PR_EMS_AB_NETWORK_ADDRESS);
retval = nspi_GetProps(nspi, SPropTagArray, &rowset);
if (retval != MAPI_E_SUCCESS) return retval;
- set_profile_mvstr_attribute(profname, rowset, 0, PR_EMS_AB_NETWORK_ADDRESS, "NetworkAddress");
+ set_profile_mvstr_attribute(profname, *rowset, 0, PR_EMS_AB_NETWORK_ADDRESS, "NetworkAddress");
return MAPI_E_SUCCESS;
}
signature.asc
Description: This is a digitally signed message part
_______________________________________________ devel mailing list [email protected] http://mailman.openchange.org/listinfo/devel
