6f8c555 Ticket 48312 - Crash when doing modrdn on managed entry

Authored and Committed by mreynolds 8 years ago
    Ticket 48312 - Crash when doing modrdn on managed entry
    
    Bug Description:  If performing a modrdn on a managed entry, where the new
                      rdn begins with a "+", the server will crash.  This is
                      caused by the way MEP creates the new managed entry - where
                      it uses the rdn attribute value from the attribute,
                      and not the DN.  So in this case the DN rdn value escapes
                      the "+", but it is not escaped in the rdn attribute in
                      the entry.  Then the internal modrdn setup thinks it
                      is a multivalued RDN, and the first RDN ends up being null.
                      This actually generates an error, but we don't return an error
                      from slapi_rename_internal_set_pb_ext(), and the operation
                      is not set in the pblock.  Then slapi_modrdn_internal_pb()
                      dereferences the operation struct, and we crash.
    
    Fix Description:  Instead when updating the managed entry during the modrdn
                      get the DN value from the DN(which is already escaped), and
                      not from the attribute value from the entry(which is not escaped).
    
                      Also improved the modrdn code to check for NULL operations
                      in the pblock, report an error, and not dereference them.
    
    https://fedorahosted.org/389/ticket/48312
    
    Reviewed by: nhosoi(Thanks!)
    
        
file modified
+15 -9