Address Book Provider implementation. More...
Macros | |
#define | TEVENT_DEPRECATED |
Functions | |
_PUBLIC_ enum MAPISTATUS | emsabp_ab_container_by_id (TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx, uint32_t ContainerID, struct ldb_message **ldb_msg) |
_PUBLIC_ enum MAPISTATUS | emsabp_ab_container_enum (TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx, uint32_t ContainerID, struct ldb_result **ldb_resp) |
_PUBLIC_ bool | emsabp_destructor (void *data) |
_PUBLIC_ enum MAPISTATUS | emsabp_EphemeralEntryID_to_Binary_r (TALLOC_CTX *mem_ctx, struct EphemeralEntryID *ephEntryID, struct Binary_r *bin) |
_PUBLIC_ enum MAPISTATUS | emsabp_fetch_attrs (TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx, struct PropertyRow_r *aRow, uint32_t MId, uint32_t dwFlags, struct SPropTagArray *pPropTags) |
_PUBLIC_ enum MAPISTATUS | emsabp_fetch_attrs_from_msg (TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx, struct PropertyRow_r *aRow, struct ldb_message *ldb_msg, uint32_t MId, uint32_t dwFlags, struct SPropTagArray *pPropTags) |
_PUBLIC_ enum MAPISTATUS | emsabp_get_account_info (TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx, const char *username, struct ldb_message **ldb_msg) |
_PUBLIC_ enum MAPISTATUS | emsabp_get_CreationTemplatesTable (TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx, uint32_t dwFlags, struct PropertyRowSet_r **SRowSet) |
_PUBLIC_ enum MAPISTATUS | emsabp_get_HierarchyTable (TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx, uint32_t dwFlags, struct PropertyRowSet_r **SRowSet) |
_PUBLIC_ struct emsabp_context * | emsabp_init (struct loadparm_context *lp_ctx, TDB_CONTEXT *tdb_ctx) |
_PUBLIC_ enum MAPISTATUS | emsabp_PermanentEntryID_to_Binary_r (TALLOC_CTX *mem_ctx, struct PermanentEntryID *permEntryID, struct Binary_r *bin) |
_PUBLIC_ void * | emsabp_query (TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx, struct ldb_message *msg, uint32_t ulPropTag, uint32_t MId, uint32_t dwFlags) |
_PUBLIC_ enum MAPISTATUS | emsabp_search (TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx, struct PropertyTagArray_r *MIds, struct Restriction_r *restriction, struct STAT *pStat, uint32_t limit) |
_PUBLIC_ enum MAPISTATUS | emsabp_search_dn (struct emsabp_context *emsabp_ctx, const char *dn, struct ldb_message **ldb_res) |
_PUBLIC_ enum MAPISTATUS | emsabp_search_legacyExchangeDN (struct emsabp_context *emsabp_ctx, const char *legacyDN, struct ldb_message **ldb_res, bool *pbUseConfPartition) |
_PUBLIC_ enum MAPISTATUS | emsabp_set_EphemeralEntryID (struct emsabp_context *emsabp_ctx, uint32_t DisplayType, uint32_t MId, struct EphemeralEntryID *ephEntryID) |
_PUBLIC_ enum MAPISTATUS | emsabp_set_PermanentEntryID (struct emsabp_context *emsabp_ctx, uint32_t DisplayType, struct ldb_message *msg, struct PermanentEntryID *permEntryID) |
_PUBLIC_ enum MAPISTATUS | emsabp_table_fetch_attrs (TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx, struct PropertyRow_r *aRow, uint32_t dwFlags, struct PermanentEntryID *permEntryID, struct PermanentEntryID *parentPermEntryID, struct ldb_message *msg, bool child) |
_PUBLIC_ bool | emsabp_verify_codepage (struct emsabp_context *emsabp_ctx, uint32_t CodePage) |
_PUBLIC_ bool | emsabp_verify_user (struct dcesrv_call_state *dce_call, struct emsabp_context *emsabp_ctx) |
Address Book Provider implementation.
#define TEVENT_DEPRECATED |
_PUBLIC_ enum MAPISTATUS emsabp_ab_container_by_id | ( | TALLOC_CTX * | mem_ctx, |
struct emsabp_context * | emsabp_ctx, | ||
uint32_t | ContainerID, | ||
struct ldb_message ** | ldb_msg | ||
) |
Fetch Address Book container record for given ContainerID
mem_ctx | memory context for allocation |
emsabp_ctx | pointer to the EMSABP context |
ContainerID | id of the container to fetch |
ldb_msg | pointer on pointer to the LDB message returned by the function |
References emsabp_search_dn(), emsabp_tdb_fetch_dn_from_MId(), emsabp_context::samdb_ctx, and emsabp_context::tdb_ctx.
Referenced by dcesrv_NspiResolveNames(), dcesrv_NspiResolveNamesW(), and emsabp_ab_container_enum().
_PUBLIC_ enum MAPISTATUS emsabp_ab_container_enum | ( | TALLOC_CTX * | mem_ctx, |
struct emsabp_context * | emsabp_ctx, | ||
uint32_t | ContainerID, | ||
struct ldb_result ** | ldb_resp | ||
) |
Enumerate AB container entries
mem_ctx | pointer to the memory context |
emsabp_ctx | pointer to the EMSABP context |
ContainerID | id of the container to fetch |
ldb_res | pointer on pointer to the LDB result returned by the function |
References emsabp_ab_container_by_id(), and emsabp_context::samdb_ctx.
Referenced by dcesrv_NspiQueryRows().
_PUBLIC_ bool emsabp_destructor | ( | void * | data) |
References emsabp_context::mem_ctx, and emsabp_context::ttdb_ctx.
Referenced by dcesrv_NspiBind().
_PUBLIC_ enum MAPISTATUS emsabp_EphemeralEntryID_to_Binary_r | ( | TALLOC_CTX * | mem_ctx, |
struct EphemeralEntryID * | ephEntryID, | ||
struct Binary_r * | bin | ||
) |
Map an EphemeralEntryID structure into a Binary_r structure
mem_ctx | pointer to the memory context |
ephEntryID | pointer to the Ephemeral EntryID structure |
bin | pointer to the Binary_r structure the server will return |
References EphemeralEntryID::DisplayType, EphemeralEntryID::ID_type, EphemeralEntryID::MId, EphemeralEntryID::ProviderUID, EphemeralEntryID::R1, EphemeralEntryID::R2, EphemeralEntryID::R3, and EphemeralEntryID::R4.
Referenced by emsabp_query().
_PUBLIC_ enum MAPISTATUS emsabp_fetch_attrs | ( | TALLOC_CTX * | mem_ctx, |
struct emsabp_context * | emsabp_ctx, | ||
struct PropertyRow_r * | aRow, | ||
uint32_t | MId, | ||
uint32_t | dwFlags, | ||
struct SPropTagArray * | pPropTags | ||
) |
Builds the SRow array entry for the specified MId.
The function retrieves the DN associated to the specified MId within its on-memory TDB database. It next fetches the LDB record matching the DN and finally retrieve the requested properties for this record.
mem_ctx | pointer to the memory context |
emsabp_ctx | pointer to the EMSABP context |
aRow | pointer to the SRow structure where results will be stored |
MId | MId to fetch properties for |
dwFlags | bit flags specifying whether or not the server must return the values of the property PidTagEntryId in the Ephemeral or Permanent Entry ID format |
pPropTags | pointer to the property tags array |
References emsabp_query(), emsabp_tdb_fetch_dn_from_MId(), emsabp_context::mem_ctx, emsabp_context::samdb_ctx, emsabp_context::tdb_ctx, and emsabp_context::ttdb_ctx.
Referenced by dcesrv_NspiGetMatches(), dcesrv_NspiGetProps(), dcesrv_NspiQueryRows(), and dcesrv_NspiSeekEntries().
_PUBLIC_ enum MAPISTATUS emsabp_fetch_attrs_from_msg | ( | TALLOC_CTX * | mem_ctx, |
struct emsabp_context * | emsabp_ctx, | ||
struct PropertyRow_r * | aRow, | ||
struct ldb_message * | ldb_msg, | ||
uint32_t | MId, | ||
uint32_t | dwFlags, | ||
struct SPropTagArray * | pPropTags | ||
) |
Build the SRow array entry for the specified ldb_message.
mem_ctx | pointer to the memory context |
emsabp_ctx | pointer to the EMSABP context |
aRow | pointer to the SRow structure where results will be stored |
ldb_msg | ldb_message record to fetch results from |
MId | MId of the entry to fetch (may be 0) |
dwFlags | input call flags (default to 0) |
pPropTags | pointer to the property tags array |
References emsabp_query(), emsabp_tdb_fetch_MId(), emsabp_tdb_insert(), and emsabp_context::ttdb_ctx.
Referenced by dcesrv_NspiQueryRows(), dcesrv_NspiResolveNames(), and dcesrv_NspiResolveNamesW().
_PUBLIC_ enum MAPISTATUS emsabp_get_account_info | ( | TALLOC_CTX * | mem_ctx, |
struct emsabp_context * | emsabp_ctx, | ||
const char * | username, | ||
struct ldb_message ** | ldb_msg | ||
) |
Get AD record for Mail-enabled account
mem_ctx | pointer to the session context |
emsabp_ctx | pointer to the EMSABP context |
username | User common name |
ldb_msg | Pointer on pointer to ldb_message to return result to |
References emsabp_context::samdb_ctx.
Referenced by emsabp_verify_user().
_PUBLIC_ enum MAPISTATUS emsabp_get_CreationTemplatesTable | ( | TALLOC_CTX * | mem_ctx, |
struct emsabp_context * | emsabp_ctx, | ||
uint32_t | dwFlags, | ||
struct PropertyRowSet_r ** | SRowSet | ||
) |
Retrieve and build the CreationTemplates Table requested by GetSpecialTable NSPI call
mem_ctx | pointer to the memory context |
emsabp_ctx | pointer to the EMSABP context |
dwFlags | flags controlling whether strings should be UNICODE or not |
SRowSet | pointer on pointer to the output SRowSet array |
Referenced by dcesrv_NspiGetSpecialTable().
_PUBLIC_ enum MAPISTATUS emsabp_get_HierarchyTable | ( | TALLOC_CTX * | mem_ctx, |
struct emsabp_context * | emsabp_ctx, | ||
uint32_t | dwFlags, | ||
struct PropertyRowSet_r ** | SRowSet | ||
) |
Retrieve and build the HierarchyTable requested by GetSpecialTable NSPI call
mem_ctx | pointer to the memory context |
emsabp_ctx | pointer to the EMSABP context |
dwFlags | flags controlling whether strings should be UNICODE or not |
SRowSet | pointer on pointer to the output SRowSet array |
References PermanentEntryID::dn, emsabp_set_PermanentEntryID(), emsabp_table_fetch_attrs(), emsabp_context::mem_ctx, and emsabp_context::samdb_ctx.
Referenced by dcesrv_NspiGetSpecialTable().
_PUBLIC_ struct emsabp_context* emsabp_init | ( | struct loadparm_context * | lp_ctx, |
TDB_CONTEXT * | tdb_ctx | ||
) |
Initialize the EMSABP context and open connections to Samba databases.
lp_ctx | pointer to the loadparm context |
tdb_ctx | pointer to the EMSABP TDB context |
References emsabp_tdb_init_tmp(), emsabp_context::lp_ctx, emsabp_context::mem_ctx, samdb_connect(), emsabp_context::samdb_ctx, emsabp_context::tdb_ctx, and emsabp_context::ttdb_ctx.
Referenced by dcesrv_NspiBind().
_PUBLIC_ enum MAPISTATUS emsabp_PermanentEntryID_to_Binary_r | ( | TALLOC_CTX * | mem_ctx, |
struct PermanentEntryID * | permEntryID, | ||
struct Binary_r * | bin | ||
) |
Map a PermanentEntryID structure into a Binary_r structure (for PR_ENTRYID and PR_EMS_AB_PARENT_ENTRYID properties)
mem_ctx | pointer to the memory context |
permEntryID | pointer to the Permanent EntryID structure |
bin | pointer to the Binary_r structure the server will return |
References PermanentEntryID::DisplayType, PermanentEntryID::dn, PermanentEntryID::ID_type, PermanentEntryID::ProviderUID, PermanentEntryID::R1, PermanentEntryID::R2, PermanentEntryID::R3, and PermanentEntryID::R4.
Referenced by emsabp_query(), and emsabp_table_fetch_attrs().
_PUBLIC_ void* emsabp_query | ( | TALLOC_CTX * | mem_ctx, |
struct emsabp_context * | emsabp_ctx, | ||
struct ldb_message * | msg, | ||
uint32_t | ulPropTag, | ||
uint32_t | MId, | ||
uint32_t | dwFlags | ||
) |
Find the attribute matching the specified property tag and return the associated data.
mem_ctx | pointer to the memory context |
emsabp_ctx | pointer to the EMSABP context |
msg | pointer to the LDB message |
ulPropTag | the property tag to lookup |
MId | Minimal Entry ID associated to the current message |
dwFlags | bit flags specifying whether or not the server must return the values of the property PidTagEntryId in the Ephemeral or Permanent Entry ID format |
References EMSABP_ADDRTYPE, emsabp_EphemeralEntryID_to_Binary_r(), emsabp_PermanentEntryID_to_Binary_r(), emsabp_property_get_attribute(), emsabp_property_get_ref_attr(), emsabp_property_is_ref(), emsabp_search_dn(), emsabp_set_EphemeralEntryID(), and emsabp_set_PermanentEntryID().
Referenced by emsabp_fetch_attrs(), and emsabp_fetch_attrs_from_msg().
_PUBLIC_ enum MAPISTATUS emsabp_search | ( | TALLOC_CTX * | mem_ctx, |
struct emsabp_context * | emsabp_ctx, | ||
struct PropertyTagArray_r * | MIds, | ||
struct Restriction_r * | restriction, | ||
struct STAT * | pStat, | ||
uint32_t | limit | ||
) |
Search Active Directory given input search criterias. The function associates for each records returned by the search a unique session Minimal Entry ID and a LDB message.
mem_ctx | pointer to the memory context |
emsabp_ctx | pointer to the EMSABP context |
MIds | pointer to the list of MIds the function returns |
restriction | pointer to restriction rules to apply to the search |
pStat | pointer the STAT structure associated to the search |
limit | the limit number of results the function can return |
References emsabp_property_get_attribute(), emsabp_tdb_fetch_MId(), emsabp_tdb_insert(), emsabp_tdb_lookup_MId(), emsabp_context::samdb_ctx, emsabp_context::tdb_ctx, and emsabp_context::ttdb_ctx.
Referenced by dcesrv_NspiGetMatches(), dcesrv_NspiSeekEntries(), and dcesrv_NspiUpdateStat().
_PUBLIC_ enum MAPISTATUS emsabp_search_dn | ( | struct emsabp_context * | emsabp_ctx, |
const char * | dn, | ||
struct ldb_message ** | ldb_res | ||
) |
Search for a given DN within AD and return the associated LDB message.
emsabp_ctx | pointer to the EMSABP context |
dn | pointer to the DN string to search for |
ldb_res | pointer on pointer to the LDB message returned by the function |
References emsabp_context::mem_ctx, and emsabp_context::samdb_ctx.
Referenced by emsabp_ab_container_by_id(), and emsabp_query().
_PUBLIC_ enum MAPISTATUS emsabp_search_legacyExchangeDN | ( | struct emsabp_context * | emsabp_ctx, |
const char * | legacyDN, | ||
struct ldb_message ** | ldb_res, | ||
bool * | pbUseConfPartition | ||
) |
Search for a given AD record given its legacyDN parameter and return the associated LDB message.
emsabp_ctx | pointer to the EMSABP context |
legacyDN | pointer to the legacyDN attribute value to lookup |
ldb_res | pointer on pointer to the LDB message returned by the function |
pbUseConfPartition | pointer on boolean specifying whether the legacyExchangeDN was retrieved from the Configuration parition or not |
References emsabp_context::mem_ctx, and emsabp_context::samdb_ctx.
Referenced by dcesrv_NspiDNToMId().
_PUBLIC_ enum MAPISTATUS emsabp_set_EphemeralEntryID | ( | struct emsabp_context * | emsabp_ctx, |
uint32_t | DisplayType, | ||
uint32_t | MId, | ||
struct EphemeralEntryID * | ephEntryID | ||
) |
Build an EphemeralEntryID structure
emsabp_ctx | pointer to the EMSABP context |
DisplayType | the AB object display type |
MId | the MId value |
ephEntryID | pointer to the EphemeralEntryID returned by the function |
References EphemeralEntryID::DisplayType, EphemeralEntryID::ID_type, EphemeralEntryID::MId, EphemeralEntryID::ProviderUID, EphemeralEntryID::R1, EphemeralEntryID::R2, EphemeralEntryID::R3, EphemeralEntryID::R4, emsabp_context::samdb_ctx, and samdb_ntds_objectGUID().
Referenced by emsabp_query().
_PUBLIC_ enum MAPISTATUS emsabp_set_PermanentEntryID | ( | struct emsabp_context * | emsabp_ctx, |
uint32_t | DisplayType, | ||
struct ldb_message * | msg, | ||
struct PermanentEntryID * | permEntryID | ||
) |
Build a PermanentEntryID structure
emsabp_ctx | pointer to the EMSABP context |
DisplayType | the AB object display type |
msg | pointer to the LDB message |
permEntryID | pointer to the PermanentEntryID returned by the function |
References PermanentEntryID::DisplayType, PermanentEntryID::dn, EMSABP_DN, GUID_NSPI, PermanentEntryID::ID_type, emsabp_context::mem_ctx, PermanentEntryID::ProviderUID, PermanentEntryID::R1, PermanentEntryID::R2, PermanentEntryID::R3, and PermanentEntryID::R4.
Referenced by emsabp_get_HierarchyTable(), and emsabp_query().
_PUBLIC_ enum MAPISTATUS emsabp_table_fetch_attrs | ( | TALLOC_CTX * | mem_ctx, |
struct emsabp_context * | emsabp_ctx, | ||
struct PropertyRow_r * | aRow, | ||
uint32_t | dwFlags, | ||
struct PermanentEntryID * | permEntryID, | ||
struct PermanentEntryID * | parentPermEntryID, | ||
struct ldb_message * | msg, | ||
bool | child | ||
) |
Builds the SRow array entry for the specified table record.
mem_ctx | pointer to the memory context |
emsabp_ctx | pointer to the EMSABP context |
aRow | pointer to the SRow structure where results will be stored |
dwFlags | flags controlling whether strings should be unicode encoded or not |
permEntryID | pointer to the current record Permanent EntryID |
parentPermEntryID | pointer to the parent record Permanent EntryID |
msg | pointer to the LDB message for current record |
child | boolean value specifying whether current record is root or child within containers hierarchy |
References AB_RECIPIENTS, AB_SUBCONTAINERS, AB_UNMODIFIABLE, emsabp_PermanentEntryID_to_Binary_r(), emsabp_tdb_fetch_MId(), emsabp_tdb_insert(), and emsabp_context::tdb_ctx.
Referenced by emsabp_get_HierarchyTable().
_PUBLIC_ bool emsabp_verify_codepage | ( | struct emsabp_context * | emsabp_ctx, |
uint32_t | CodePage | ||
) |
Check if the provided codepage is correct
emsabp_ctx | pointer to the EMSABP context |
CodePage | the codepage identifier |
Referenced by dcesrv_NspiBind().
_PUBLIC_ bool emsabp_verify_user | ( | struct dcesrv_call_state * | dce_call, |
struct emsabp_context * | emsabp_ctx | ||
) |
Check if the authenticated user belongs to the Exchange organization
dce_call | pointer to the session context |
emsabp_ctx | pointer to the EMSABP context |
References emsabp_context::account_name, emsabp_get_account_info(), and emsabp_context::mem_ctx.
Referenced by dcesrv_NspiBind().
![]() ![]() ![]() |
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |