https://fedorahosted.org/389/ticket/367
https://fedorahosted.org/389/attachment/ticket/367/0001-Ticket-367-Invali...
Note: I also did some code cleanup with indentation, but the the fix is
just to return -1, instead of LDAP_LOCAL_ERROR(-2).
Thanks,
Mark