Ticket #47834 - Tombstone_to_glue: if parents are also converted to glue, the target entry's DN must be adjusted.

Bug Description: Test case to verify the problem crashed the server.

Fix Description:
1. Clean up entry cache related code
1-1. Changing cache log reentrant to avoid self deadlock.
1-2. Introducing cache_is_in_cache to get rid of local variables in
     ldap_back_{add,delete,modify,modrdn}.
2. ldap_back_{add,delete,modify,modrdn}
2-1. As described in 1-2, removed [a-z]*_in_cache local variables.
2-2. In the deadlock retry loop, entries were duplicated by backentry_
     dup after CACHE_REMOVE'd and CACHE_RETURN'ed.  At the moment, the
     entry could be already freed.  Changed to create a duplicated
	 entry before calling CACHE_REMOVE and CACHE_RETURN.
3. _cl5NewDBFile (replication/cl5_api.c): When a leftover semaphore is
   found, _cl5NewDBFile removes it and creates it, but it rarely fails
   to delete and it causes the server restart fail.  Adding a message
   to remove such a leftover semaphore by ipcrm.

https://fedorahosted.org/389/ticket/47834

Reviewed by mreynolds@redhat.com (Thank you, Mark!!)
(cherry picked from commit 6333936da2c4287e96b36fecc24a4c62da5a8ea2)
Ticket 47877 - check_and_add_entry fails for changetype: add and existing entry

Bug Description:  If an ldif file in the updates directory contains
			changetype: add, the add fails if the entry
			already exist

Fix Description:   ignore existing entries also in case of
			explicite changetype

https://fedorahosted.org/389/ticket/47877

Reviewed by: ?
Ticket 47816 -v2- internal syncrepl searches are flagged as unindexed

Bug Description:  if syncrepl is enabled it uses an attribute targetuniqueid
			for internal searches. this is not indexed and
			lot of warnings are logged

Fix Description:   add an equality index to the default indexes
			for exising instances tit will add the index
			to the changelog backend and trigge a reindex

https://fedorahosted.org/389/ticket/47816

Reviewed by: ?

Conflicts:
	ldap/ldif/template-dse.ldif.in
Ticket 47866 - Errors after upgrading related to attribute "dnaremotebindmethod"

Bug Description:  the dnaSharedConfig entries can contain "(null)" values

Fix Description:   check if remoteBindDn and remoteConnProtocol are set, before
                   creating a vaue for teh entries.
                   NOTE: if these values aready have been created they have to be
                   deleted and the server restarted

https://fedorahosted.org/389/ticket/47866

Reviewed by: mark, thanks
Ticket 47871 - 389-ds-base-1.3.2.21-1.fc20 crashed over the weekend

Bug Description:
	Retro-changelog trimming uses a slapi_search_internal_callback_pb to check
	if the oldest record needs to be trim.
	The callback function handle_getchangerecord_search stores the entry
	in the callback structure.
	Later it evaluates the entry to check its changetime.
	This is not valid, as the entry is only valid inside the callback.

Fix Description:
	The callback function 'handle_getchangetime_search' evaluate
	the changetime and returns it in the callback struct.

https://fedorahosted.org/389/ticket/47871

Reviewed by: Noriko Hosoi (Thanks Noriko !)

Platforms tested: F17/F20

Flag Day: no

Doc impact: no
Bump version to 1.3.2.23
Ticket 47457 - default nsslapd-sasl-max-buffer-size should be 2MB

Description:  Increase the default max buffer size to 2mb from 64k.

https://fedorahosted.org/389/ticket/47457

Reviewed by: richm(Thanks!)

(cherry picked from commit 846447c62e3ad2150b054c87c96e797dc1d803f3)
Ticket 47885 - deref plugin should not return references with noc access rights

Bug Description:  deref shows derefernced entries for which th client doesn't
                  have access as dn and empty attribute list

Fix Description:   if client has no accesss to the derferernced entry then
                   omit it from the list in the deref control
                   In general, if no entries are returned don't send an empty control

https://fedorahosted.org/389/ticket/47885

Reviewed by: noriko, thanks
Ticket #47875 - dirsrv not running with old openldap

Description: To check libldif, -lldap$ol_libver needs to be added
to LDFLAGS to compile test conftest.c.

(cherry picked from commit 8c7ac72659758ef1ea96794552e584fdbe803778)
(cherry picked from commit 84f91ddac5020295cbc0a3f84f14ab24f539ed00)
Ticket #47875 - dirsrv not running with old openldap

Description: removed unnecessary checking for -lldif from openldap.m4.
(cherry picked from commit 0172a730686eaa054dd5b7b0a8921a6638af63aa)
(cherry picked from commit 48b3153aee7cb2b1f65554b9da432004d23f10e7)
Ticket #47748 - Simultaneous adding a user and binding as the user could fail in the password policy check

Description: commit 4fc53e1a63222d0ff67c30a59f2cff4b535f90a8 fix for
Ticket #47748 introduced a bug: "Simple bind hangs after enabling
password policy".

In do_bind, slapi_check_account_lock and need_new_pw overwrote the
return code from backend bind which is used later. This patch fixes
it not to override the return code.

https://fedorahosted.org/389/ticket/47748

Reviewed by mreynolds@redhat.com (Thank you, Mark!!)

(cherry picked from commit 4f11606b02419c8ccdb319b8040e683af9109d1b)
(cherry picked from commit 8c82941c0f2b0b5d7fa698a1ca3e4f26245cf85a)
Ticket #47834 - Tombstone_to_glue: if parents are also converted to glue, the target entry's DN must be adjusted.

Description: Previous fix for the ticket #47834 broke the CI test case
47815.

The fix for 47815 removed the addingentry from the entry cache if
SLAPI_PLUGIN_BE_TXN_POST_ADD_FN failed.  The #47834 patch accidentally
deleted the code.

Instead of adding it back, this patch moves the deletion of the entry
from the entry cache to cover both cases SLAPI_PLUGIN_BE_TXN_POST_ADD
_FN successes or fails.

https://fedorahosted.org/389/ticket/47834

Reviewed by mreynolds@redhat.com (Thank you, Mark!!)

(cherry picked from commit 7db4fa90caa543b59352046138f453236c0fd652)
(cherry picked from commit 78fdd6165cb2c9da4e30452ebdcdcf7aad3d30c7)
fix for 47885 did not always return a response control

reviewd by rich, thanks