151ccf0 Bug 692331 - Segfault on index update during full replication push on 1.2.7.5

Authored and Committed by rmeggins 13 years ago
    Bug 692331 - Segfault on index update during full replication push on 1.2.7.5
    
    https://bugzilla.redhat.com/show_bug.cgi?id=692331
    Resolves: bug 692331
    Bug Description: Segfault on index update during full replication push on 1.2.7.5
    Reviewed by: nkinder (Thanks!)
    Branch: RHEL-6
    Fix Description: The collation plugin still uses the old style index key
    generation function that uses struct berval **.  If we don't find a new
    style index key function that uses Slapi_Value**, wrap the old function
    to convert Slapi_Value** to struct berval **
    The plugin_mr code keeps track of the Slapi_Value**.  The old style
    collation code keeps track of and deletes the struct berval** values.
    We store the output keys in the MR_KEYS pblock field and free them
    in the indexer destroyer code.  The new style mr indexer code sets
    MR_KEYS to NULL so the indexer destroyer code won't try to free them
    again.
    Steps to reproduce:
    1) find or create an attribute which has an ORDERING matching rule
    (and not via inheritance - that's another bug)
    2) add or change the index for the attribute to have an nsMatchingRule
    with one of the l10n matching rules defined by the collation plugin
    e.g. 2.16.840.1.113730.3.3.2.11.1 for en or en-US
    3) add an entry which has that attribute and a valid value
    4) do an import or re-index
    
    It crashes in matchrule_values_to_keys_sv because mrINDEX is NULL
    because the old style collation plugin indexer does not support
    Slapi_Values.
    Platforms tested: RHEL6 x86_64
    Flag Day: no
    Doc impact: no
    
    squash with previous commit
    (cherry picked from commit 62a7368e3aed00b44d9f1828b9235d0a2d7572cd)
    (cherry picked from commit e98229a602b3acfafd616afda743d268dae42ff2)