mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-30 03:29:35 -05:00
Let at_find find the AttributeType that matches a given AttributeDescription.
Useful to deal with things like userCertificate;binary.
This commit is contained in:
parent
654fefc74a
commit
c7a7829c00
1 changed files with 17 additions and 1 deletions
|
|
@ -386,11 +386,27 @@ at_find(
|
|||
)
|
||||
{
|
||||
struct aindexrec *air = NULL;
|
||||
char *p, *tmpname = NULL;
|
||||
|
||||
if ( (air = (struct aindexrec *) avl_find( attr_index, name,
|
||||
/*
|
||||
* The name may actually be an AttributeDescription, i.e. it may
|
||||
* contain options. Let's deal with it.
|
||||
*/
|
||||
p = strchr( name, ';' );
|
||||
if ( p ) {
|
||||
tmpname = ch_malloc( p-name+1 );
|
||||
strncpy( tmpname, name, p-name );
|
||||
tmpname[p-name] = '\0';
|
||||
} else
|
||||
tmpname = (char *)name;
|
||||
if ( (air = (struct aindexrec *) avl_find( attr_index, tmpname,
|
||||
(AVL_CMP) attr_index_name_cmp )) != NULL ) {
|
||||
if ( tmpname != name )
|
||||
ldap_memfree( tmpname );
|
||||
return( air->air_at );
|
||||
}
|
||||
if ( tmpname != name )
|
||||
ldap_memfree( tmpname );
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue