Trac Ticket #335 - transaction retries need to be cache aware

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

Fix description:
Commit bddb5a45f2cd27705cb6629f436ef9a7e2248677 includes this fix:
> Additinally, error checking for the conflict value in index_add_mods
> was week (curr_attr). This patch is adding the check.

The fix was incomplete.  If an add-attempted attribute type itself
does not exist in the entry (not only the attribute value) after
mods applied, the attribute type/value should not have been indexed.
This patch fixes it.
Coverity Fix

issue 12777

Bug Description:  incorrectly used var r instead of rc
fix coverity issues with uninit vals, no return checking

12766 Uninitialized pointer read
In _entryrdn_replace_suffix_id(): Reads an uninitialized pointer or its target
12765 Uninitialized pointer read
In txn_test_threadmain(): Reads an uninitialized pointer or its target
12764 Unchecked return value
In txn_test_threadmain(): Value returned from a function is not checked for errors before being used
12763 Unchecked return value
In entrycache_replace(): Value returned from a function is not checked for errors before being used
12762 Unchecked return value
In entrycache_add_int(): Value returned from a function is not checked for errors before being used
Reviewed by: mreynolds (Thanks!)
(cherry picked from commit 98784ec829061e969c84b3cd5882326a0376ebd6)
Ticket #360 - ldapmodify returns Operations error - fix delete caching

https://fedorahosted.org/389/ticket/360
Resolves: Ticket #360
Bug Description: ldapmodify returns Operations error - fix delete caching
Reviewed by: nkinder
Branch: master
Fix Description: Previous commit was wrong.  When retrying the op, have
to remove the tombstone, if any, from the cache first, then add back
the original entry.
Platforms tested: RHEL6 x86_64, Fedora 17
Flag Day: no
Doc impact: no
improve txn test index handling

Sometimes it is difficult to determine which indexes actually have files,
and the txn thread would keep looping forever looking for missing files.
This changes the txn thread to retry a few times, then just start skipping
missing indexes.  The txn thread will log which indexes it uses and which
it skipped.
Ticket #387 - managed entry sometimes doesn't delete the managed entry

https://fedorahosted.org/389/ticket/387
Resolves: Ticket #387
Bug Description: managed entry sometimes doesn't delete the managed entry
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: A modify just replaces the old entry in the cache with
the new entry, and the modify code only does the cache_replace if the
database operations succeed, so we don't have to do any cache cleanup
in the txn retry loop.  Also cleanup some other cache usage.
Platforms tested: RHEL6 x86_64, Fedora 17
Flag Day: no
Doc impact: no
Ticket #387 - managed entry sometimes doesn't delete the managed entry

https://fedorahosted.org/389/ticket/387
Resolves: Ticket #387
Bug Description: managed entry sometimes doesn't delete the managed entry
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: A modify just replaces the old entry in the cache with
the new entry, and the modify code only does the cache_replace if the
database operations succeed, so we don't have to do any cache cleanup
in the txn retry loop.  Also cleanup some other cache usage.  If there
is an error and ec is in the cache, we still have to remove it and restore
the original e entry.
Platforms tested: RHEL6 x86_64, Fedora 17
Flag Day: no
Doc impact: no
Bug 829213 - unhashed#user#password visible after changing password https://bugzilla.redhat.com/show_bug.cgi?id=829213

Bug 830001 - unhashed#user#password visible after changing password [rhel-6.3]
https://bugzilla.redhat.com/show_bug.cgi?id=830001

Bug Description: unhashed password is stored in the entry in memory
when an entry/a password is added or the password is modified.
The password could be visible by the ordinary search if the type
"unhashed#user#password" is specified in the attribute list.

Fix Description:
1. Set "unhashed#user#password" to the forbidden attribute list,
   which is dropped from the search attribute list.
2. Get effective right does not return "unhashed#user#password"
3. In the modify operation, adding "unhashed#user#password" to or
   deleting "unhashed#user#password" from the entry never returns
   an error regardless of the attribute value.  Internally, the
   operation is ignored.
(cherry picked from commit 9df3c438ebd05bbaa5e7b2506fc5d5e9f3ff4a95)
(cherry picked from commit 8f0811a86a1b233cf9566349653ef7f184278144)
(Fixed conflicts in ldap/servers/slapd/{entry.c,entrywsi.c,slapi-private.h)
Bug 829213 - unhashed#user#password visible after changing password https://bugzilla.redhat.com/show_bug.cgi?id=829213

Bug 830001 - unhashed#user#password visible after changing password [rhel-6.3]
https://bugzilla.redhat.com/show_bug.cgi?id=830001

Bug Description: Deref still retrieved unhashed password.

Fix Description: Added code to Deref plugin to check the deref attribute.
If it is unhashed password, skip it.
(cherry picked from commit 26b5121d84232cf453fa917f11ba6518a40358ea)
Bug 829213 - unhashed#user#password visible after changing password https://bugzilla.redhat.com/show_bug.cgi?id=829213

Bug 830001 - unhashed#user#password visible after changing password [rhel-6.3]
https://bugzilla.redhat.com/show_bug.cgi?id=830001

Bug Description: unhashed#user#password is skipped to check acl
in acl_check_mod.

Fix Description: Set SLAPI_ATTR_FLAG_NOUSERMOD to unhashed#user#
password schema.  It makes clients' modifying the unhashed password
fail by UNWILLING TO PERFORM.
(cherry picked from commit 1629311d7201a6a7842db15865e02042a2894383)
audit log does not log unhashed password: enabled, by default.
fix for trac #173; update ds-logpipe.py docs about -t option