mreynolds / 389-ds-base

Forked from 389-ds-base 6 years ago
Clone

0f49793 Bug 658312 - Allow mapped attribute types to be quoted

Authored and Committed by nkinder 13 years ago
    Bug 658312 - Allow mapped attribute types to be quoted
    
    This patch enhances the way mapped attributes can be defined in a
    managed entry template.  There are three scenarios that this patch
    adds support for.  The first is to allow a mapping in the template
    entry that maps the DN like this:
    
        attr: $dn
    
    The second thing is to stop parsing an attribute variable at the
    first character that is not legal in an attribute name (see RFC
    4512 for what is legal).  This allows a mapping like this to work:
    
        attr: cn=$cn,dc=example,dc=com
    
    The third thing is to allow quoting of an attribute variable. This
    allows one to append anything to the end of a mapped attribute value,
    even if it begins with a character that is valid for use in an
    attribute name.  An example of this sort of mapping is:
    
        attr: ${cn}test
    
    I also fixed a crash that could occur when one created an invalid
    managed entry template.  The test managed entry that is created
    from the pending template ends up being NULL, but we still try
    to check if that entry violates the schema.  If the test entry is
    not able to be created, we should not try to check it against the
    schema as that causes a NULL dereference.