EMSMDB Provider implementation. More...
#include "mapiproxy/dcesrv_mapiproxy.h"#include "dcesrv_exchange_emsmdb.h"#include "mapiproxy/libmapiserver/libmapiserver.h"#include "mapiproxy/libmapiproxy/fault_util.h"Macros | |
| #define | TEVENT_DEPRECATED |
Functions | |
| _PUBLIC_ bool | emsmdbp_destructor (void *data) |
| _PUBLIC_ enum MAPISTATUS | emsmdbp_fetch_organizational_units (TALLOC_CTX *mem_ctx, struct emsmdbp_context *emsmdbp_ctx, char **organization_name, char **group_name) |
| _PUBLIC_ enum MAPISTATUS | emsmdbp_get_org_dn (struct emsmdbp_context *emsmdbp_ctx, struct ldb_dn **basedn) |
| _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 *oc_ctx) |
| static int | emsmdbp_mapi_handles_destructor (void *data) |
| static int | emsmdbp_mapi_store_destructor (void *data) |
| _PUBLIC_ void * | emsmdbp_openchangedb_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_ bool | emsmdbp_set_session_uuid (struct emsmdbp_context *emsmdbp_ctx, struct GUID uuid) |
| _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) |
| struct ldb_context * | samdb_connect (TALLOC_CTX *, struct tevent_context *, struct loadparm_context *, struct auth_session_info *, unsigned int) |
| static struct ldb_context * | samdb_init (struct loadparm_context *lp_ctx) |
Variables | |
| static struct GUID | MagicGUID |
| const struct GUID *const | MagicGUIDp = &MagicGUID |
| static struct ldb_context * | samdb_ctx = NULL |
EMSMDB Provider implementation.
| #define TEVENT_DEPRECATED |
| _PUBLIC_ bool emsmdbp_destructor | ( | void * | data | ) |
References emsmdbp_context::mem_ctx, and emsmdbp_context::oc_ctx.
Referenced by dcesrv_EcDoConnect(), and dcesrv_EcDoConnectEx().
| _PUBLIC_ enum MAPISTATUS emsmdbp_fetch_organizational_units | ( | TALLOC_CTX * | mem_ctx, |
| struct emsmdbp_context * | emsmdbp_ctx, | ||
| char ** | organization_name, | ||
| char ** | group_name | ||
| ) |
Extract organization name and group name from the legacy exchange dn of the current logged user.
| mem_ctx | memory context used for returned values |
| emsmdbp_ctx | pointer to the EMSMDBP context |
| organization_name | pointer to the returned organization name |
| group_name | pointer to the returned group name |
References emsmdbp_context::szUserDN.
Referenced by emsmdbp_get_org_dn(), emsmdbp_mailbox_provision(), and mapiserver_get_administrative_group_legacyexchangedn().
| _PUBLIC_ enum MAPISTATUS emsmdbp_get_org_dn | ( | struct emsmdbp_context * | emsmdbp_ctx, |
| struct ldb_dn ** | basedn | ||
| ) |
Get the organization name (like "First Organization") as a DN.
| emsmdbp_ctx | pointer to the EMSMDBP context |
| basedn | pointer to the returned struct ldb_dn |
References emsmdbp_fetch_organizational_units(), and emsmdbp_context::samdb_ctx.
Referenced by EcDoRpc_RopGetAddressTypes(), and mapiserver_get_administrative_group_legacyexchangedn().
| _PUBLIC_ int emsmdbp_guid_to_replid | ( | struct emsmdbp_context * | emsmdbp_ctx, |
| const char * | username, | ||
| const struct GUID * | guidP, | ||
| uint16_t * | replidP | ||
| ) |
References MagicGUIDp, emsmdbp_context::mstore_ctx, emsmdbp_context::oc_ctx, and openchangedb_get_MailboxReplica().
Referenced by EcDoRpc_RopIdFromLongTermId(), EcDoRpc_RopSyncImportReadStateChanges(), oxcfxics_fmid_from_source_key(), oxcfxics_table_set_cn_restriction(), and oxomsg_mapistore_handle_message_relocation().
| _PUBLIC_ struct emsmdbp_context* emsmdbp_init | ( | struct loadparm_context * | lp_ctx, |
| const char * | username, | ||
| void * | oc_ctx | ||
| ) |
Initialize the EMSMDBP context and open connections to Samba databases.
| lp_ctx | pointer to the loadparm_context |
| username | account name for current session |
| ldb_ctx | pointer to the openchange dispatcher ldb database |
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, emsmdbp_context::samdb_ctx, samdb_init(), and emsmdbp_context::username.
Referenced by dcesrv_EcDoConnect(), and dcesrv_EcDoConnectEx().
|
static |
Release the MAPI handles context used by EMSMDB provider context
| data | pointer on data to destroy |
References mapi_handles_release().
Referenced by emsmdbp_init().
|
static |
Release the MAPISTORE context used by EMSMDB provider context
| data | pointer on data to destroy |
Referenced by emsmdbp_init().
| _PUBLIC_ void* emsmdbp_openchangedb_init | ( | struct loadparm_context * | lp_ctx | ) |
Open openchange.ldb database
| lp_ctx | pointer on the loadparm_context |
References emsmdbp_context::lp_ctx, and mapiproxy_server_openchangedb_init().
Referenced by dcesrv_exchange_emsmdb_init().
| _PUBLIC_ int emsmdbp_replid_to_guid | ( | struct emsmdbp_context * | emsmdbp_ctx, |
| const char * | username, | ||
| const uint16_t | replid, | ||
| struct GUID * | guidP | ||
| ) |
References MagicGUID, emsmdbp_context::mstore_ctx, emsmdbp_context::oc_ctx, and openchangedb_get_MailboxReplica().
Referenced by EcDoRpc_RopGetLocalReplicaIds(), EcDoRpc_RopLongTermIdFromId(), EcDoRpc_RopSyncImportMessageMove(), emsmdbp_source_key_from_fmid(), oxcfxics_fill_transfer_state_arrays(), oxcfxics_push_folderChange(), and oxcfxics_push_messageChange().
| _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
| mem_ctx | pointer to the memory context |
| emsmdbp_ctx | pointer to the EMSMDBP context |
| recipient | pointer to the recipient string |
| properties | array of properties to lookup for a recipient |
| row | the RecipientRow to fill in |
References libmapiserver_push_property(), and emsmdbp_context::samdb_ctx.
| _PUBLIC_ bool emsmdbp_set_session_uuid | ( | struct emsmdbp_context * | emsmdbp_ctx, |
| struct GUID | uuid | ||
| ) |
Associate the session uuid to the emsmdb context
| emsmdbp_ctx | pointer to the emsmdb context |
| uuid | the uuid to associate |
References emsmdbp_context::session_uuid.
Referenced by dcesrv_EcDoConnectEx().
| _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
| dce_call | pointer to the session context |
| emsmdbp_ctx | pointer to the EMSMDBP context |
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
| dce_call | pointer to the session context |
| emsmdbp_ctx | pointer to the EMSMDBP context |
| legacyExchangeDN | pointer to the userDN to lookup |
| msg | pointer on pointer to the LDB message matching the record |
References emsmdbp_context::samdb_ctx.
Referenced by dcesrv_EcDoConnect(), and dcesrv_EcDoConnectEx().
| struct ldb_context* samdb_connect | ( | TALLOC_CTX * | , |
| struct tevent_context * | , | ||
| struct loadparm_context * | , | ||
| struct auth_session_info * | , | ||
| unsigned | int | ||
| ) |
Referenced by samdb_init().
|
static |
Initialize ldb_context to samdb, creates one for all emsmdbp contexts
| lp_ctx | pointer to the loadparm context |
References OC_PANIC, samdb_connect(), samdb_connect_url(), and samdb_ctx.
Referenced by emsmdbp_init().
|
static |
Referenced by emsmdbp_replid_to_guid().
| const struct GUID* const MagicGUIDp = &MagicGUID |
Referenced by emsmdbp_guid_to_replid().
|
static |
Referenced by samdb_init().
|
|
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |