emsmdbp.c File Reference

EMSMDB Provider implementation. More...

Macros

#define TEVENT_DEPRECATED
 

Functions

_PUBLIC_ bool emsmdbp_destructor (void *data)
 
_PUBLIC_ int emsmdbp_guid_to_replid (struct emsmdbp_context *emsmdbp_ctx, const char *username, const struct GUID *guidP, uint16_t *replidP)
 
_PUBLIC_ struct emsmdbp_contextemsmdbp_init (struct loadparm_context *lp_ctx, const char *username, void *ldb_ctx)
 
static int emsmdbp_mapi_handles_destructor (void *data)
 
static int emsmdbp_mapi_store_destructor (void *data)
 
_PUBLIC_ void * emsmdbp_openchange_ldb_init (struct loadparm_context *lp_ctx)
 
_PUBLIC_ int emsmdbp_replid_to_guid (struct emsmdbp_context *emsmdbp_ctx, const char *username, const uint16_t replid, struct GUID *guidP)
 
_PUBLIC_ enum MAPISTATUS emsmdbp_resolve_recipient (TALLOC_CTX *mem_ctx, struct emsmdbp_context *emsmdbp_ctx, char *recipient, struct mapi_SPropTagArray *properties, struct RecipientRow *row)
 
_PUBLIC_ int emsmdbp_source_key_from_fmid (TALLOC_CTX *mem_ctx, struct emsmdbp_context *emsmdbp_ctx, const char *username, uint64_t fmid, struct Binary_r **source_keyP)
 
_PUBLIC_ bool emsmdbp_verify_user (struct dcesrv_call_state *dce_call, struct emsmdbp_context *emsmdbp_ctx)
 
_PUBLIC_ bool emsmdbp_verify_userdn (struct dcesrv_call_state *dce_call, struct emsmdbp_context *emsmdbp_ctx, const char *legacyExchangeDN, struct ldb_message **msg)
 

Variables

static struct GUID MagicGUID
 
struct GUID *const MagicGUIDp = &MagicGUID
 

Detailed Description

EMSMDB Provider implementation.

Macro Definition Documentation

#define TEVENT_DEPRECATED

Function Documentation

_PUBLIC_ bool emsmdbp_destructor ( void *  data)
_PUBLIC_ int emsmdbp_guid_to_replid ( struct emsmdbp_context emsmdbp_ctx,
const char *  username,
const struct GUID *  guidP,
uint16_t *  replidP 
)
_PUBLIC_ struct emsmdbp_context* emsmdbp_init ( struct loadparm_context *  lp_ctx,
const char *  username,
void *  ldb_ctx 
)

Initialize the EMSMDBP context and open connections to Samba databases.

Parameters
lp_ctxpointer to the loadparm_context
usernameaccount name for current session
ldb_ctxpointer to the openchange dispatcher ldb database
Returns
Allocated emsmdbp_context pointer on success, otherwise NULL

References emsmdbp_mapi_handles_destructor(), emsmdbp_mapi_store_destructor(), emsmdbp_context::handles_ctx, emsmdbp_context::lp_ctx, mapi_handles_init(), emsmdbp_context::mem_ctx, emsmdbp_context::mstore_ctx, emsmdbp_context::oc_ctx, samdb_connect(), and emsmdbp_context::samdb_ctx.

Referenced by dcesrv_EcDoConnect(), and dcesrv_EcDoConnectEx().

static int emsmdbp_mapi_handles_destructor ( void *  data)
static

Release the MAPI handles context used by EMSMDB provider context

Parameters
datapointer on data to destroy
Returns
0 on success, otherwise -1

References mapi_handles_release().

Referenced by emsmdbp_init().

static int emsmdbp_mapi_store_destructor ( void *  data)
static

Release the MAPISTORE context used by EMSMDB provider context

Parameters
datapointer on data to destroy
Returns
0 on success, otherwise -1

Referenced by emsmdbp_init().

_PUBLIC_ void* emsmdbp_openchange_ldb_init ( struct loadparm_context *  lp_ctx)

Open openchange.ldb database

Parameters
lp_ctxpointer on the loadparm_context
Note
This function is just a wrapper over mapiproxy_server_openchange_ldb_init
Returns
Allocated LDB context on success, otherwise NULL

References mapiproxy_server_openchange_ldb_init().

Referenced by dcesrv_exchange_emsmdb_init().

_PUBLIC_ enum MAPISTATUS emsmdbp_resolve_recipient ( TALLOC_CTX *  mem_ctx,
struct emsmdbp_context emsmdbp_ctx,
char *  recipient,
struct mapi_SPropTagArray *  properties,
struct RecipientRow *  row 
)

Resolve a recipient and build the associated RecipientRow structure

Parameters
mem_ctxpointer to the memory context
emsmdbp_ctxpointer to the EMSMDBP context
recipientpointer to the recipient string
propertiesarray of properties to lookup for a recipient
rowthe RecipientRow to fill in
Note
This is a very preliminary implementation with a lot of pseudo-hardcoded things. Lot of work is required to make this function generic and to cover all different cases
Returns
Allocated RecipientRow on success, otherwise NULL

References libmapiserver_push_property(), and emsmdbp_context::samdb_ctx.

_PUBLIC_ int emsmdbp_source_key_from_fmid ( TALLOC_CTX *  mem_ctx,
struct emsmdbp_context emsmdbp_ctx,
const char *  username,
uint64_t  fmid,
struct Binary_r **  source_keyP 
)
_PUBLIC_ bool emsmdbp_verify_user ( struct dcesrv_call_state *  dce_call,
struct emsmdbp_context emsmdbp_ctx 
)

Check if the authenticated user belongs to the Exchange organization and is enabled

Parameters
dce_callpointer to the session context
emsmdbp_ctxpointer to the EMSMDBP context
Returns
true on success, otherwise false

References emsmdbp_context::mstore_ctx, emsmdbp_context::oc_ctx, openchangedb_get_MailboxReplica(), emsmdbp_context::samdb_ctx, and emsmdbp_context::username.

Referenced by dcesrv_EcDoConnect(), and dcesrv_EcDoConnectEx().

_PUBLIC_ bool emsmdbp_verify_userdn ( struct dcesrv_call_state *  dce_call,
struct emsmdbp_context emsmdbp_ctx,
const char *  legacyExchangeDN,
struct ldb_message **  msg 
)

Check if the user record which legacyExchangeDN points to belongs to the Exchange organization and is enabled

Parameters
dce_callpointer to the session context
emsmdbp_ctxpointer to the EMSMDBP context
legacyExchangeDNpointer to the userDN to lookup
msgpointer on pointer to the LDB message matching the record
Note
Users can set msg to NULL if they do not intend to retrieve the message
Returns
true on success, otherwise false

References emsmdbp_context::samdb_ctx.

Referenced by dcesrv_EcDoConnect(), and dcesrv_EcDoConnectEx().

Variable Documentation

struct GUID MagicGUID
static
Initial value:
= {
.time_low = 0xbeefface,
.time_mid = 0xcafe,
.time_hi_and_version = 0xbabe,
.clock_seq = { 0x12, 0x34 },
.node = { 0xde, 0xad, 0xfa, 0xce, 0xca, 0xfe }
}

Referenced by emsmdbp_replid_to_guid().

struct GUID* const MagicGUIDp = &MagicGUID

Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/