Fix compilation with samba release > 4.1.4 - use new API functions
introduced to access opaque assoc_group_id

(cherry picked from commit 73a49af50bf0a496cfe62f49e60a662f1d04d685)
Remove 4.1.4 limitation when running make samba-git

(cherry picked from commit acd0c87442a4a71062eead51e20ac6a4a76e8e11)
Revert "Fix compilation with samba release > 4.1.4 - use new API functions"

This reverts commit f160e5482599ff7d7f03ff6b1c7d550cf382b7da.
ocsmanager uses openchangedb with ldb when is not provisioned with mysql backends
Move libmysqlclient detection in configure.ac
add mysql libs to unittest compilation
emsabp_property: Fix PropTag mapping when resolving PropTag to attribute name

With this fix, no matter what the type of input PropTag is,
we are going to search both for Ansi and Unicode version.

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
dcesrv/spiGetProps: Move code to make PtypError property values in separate function

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
dcesrv/NspiQueryRows: Return PtypError prop values when we can't find MId requested

NspiQueryRows should behave like NspiGetProps when MId can't be resolved.
See: 3.1.4.1.8 NspiQueryRows

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
emsmdb: emsmdbp_object_get_fid_by_name should use current mailbox username

Using session username (eg. emsmdbp_ctx->username) is wrong as
we may have parent_object opened in different mailbox

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
emsmdb: Use mailbox->owner_username in emsmdbp_object_open_folder()

Using session username (eg. emsmdbp_ctx->username) is wrong as
we may have parent_object opened in different mailbox

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
emsmdb: Use mailbox->owner_username in emsmdbp_object_get_properties_mailbox()

Using session username (eg. emsmdbp_ctx->username) is wrong as
we may have parent_object opened in different mailbox

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
emsmdb: Extend emsmdbp_get_parent_fid() to accep and use mailbox object
for 'fid' to get parent of

FID are not unique for the whole system anymore.
NOTE: This patch assumes that FIDs are unique at least
for user's mailbox

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
emsmdb: Use mailbox context in emsmdbp_object_open_folder_by_fid()
to resolve FIDs

FIDs are no more unique for whole system but rather that unique
in context of the mailbox

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
emsmdb: emsmdbp_object_open_folder_by_fid - remove obscure 'else' and add sanity checks
on input parameters

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
emsmdb: emsmdbp_object_open_folder_by_fid - move local variable into local context

Keeping 'parent_object' into per-function context, although it is not
globally used, may lead to hard times debugging after fixing something

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
mysqldb: Fix message_get_property() to not crash in case proptag requested is not found

Also add small optimisation while comparing properties.name
with precalculating requested proptag name length

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
ldb_db: get_mapistoreURI() fix potential memory leak

afaik, get_mapistoreURI() with mailboxstore = false is not used
anywhere but still

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>