Backport lastest LDAP features