mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 16:19:35 -05:00
SLAPD_SCHEMA_NOT_COMPAT: add subtype aware is_at_syntax()
This commit is contained in:
parent
c98f0ea02c
commit
229e12b69d
3 changed files with 21 additions and 4 deletions
|
|
@ -335,8 +335,8 @@ parse_acl(
|
|||
}
|
||||
|
||||
|
||||
if( strcmp( b->a_dn_at->ad_type->sat_oid,
|
||||
SLAPD_OID_DN_SYNTAX ) != 0 )
|
||||
if( !is_at_syntax( b->a_dn_at->ad_type,
|
||||
SLAPD_OID_DN_SYNTAX ) )
|
||||
{
|
||||
fprintf( stderr,
|
||||
"%s: line %d: dnattr \"%s\": "
|
||||
|
|
@ -461,8 +461,8 @@ parse_acl(
|
|||
}
|
||||
|
||||
#ifdef SLAPD_SCHEMA_NOT_COMPAT
|
||||
if( strcmp( b->a_group_at->ad_type->sat_oid,
|
||||
SLAPD_OID_DN_SYNTAX ) != 0 )
|
||||
if( !is_at_syntax( b->a_group_at->ad_type,
|
||||
SLAPD_OID_DN_SYNTAX ) )
|
||||
{
|
||||
fprintf( stderr,
|
||||
"%s: line %d: group \"%s\": inappropriate syntax: %s\n",
|
||||
|
|
|
|||
|
|
@ -173,6 +173,19 @@ at_fake_if_needed(
|
|||
|
||||
#endif
|
||||
|
||||
int is_at_syntax(
|
||||
AttributeType *at,
|
||||
const char *oid )
|
||||
{
|
||||
for( ; at != NULL; at = at->sat_sup ) {
|
||||
if( at->sat_syntax_oid ) {
|
||||
return ( strcmp( at->sat_syntax_oid, oid ) == 0 );
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_at_subtype(
|
||||
AttributeType *sub,
|
||||
AttributeType *sup )
|
||||
|
|
|
|||
|
|
@ -100,6 +100,10 @@ LIBSLAPD_F (int) is_at_subtype LDAP_P((
|
|||
AttributeType *sub,
|
||||
AttributeType *super ));
|
||||
|
||||
LIBSLAPD_F (int) is_at_syntax LDAP_P((
|
||||
AttributeType *at,
|
||||
const char *oid ));
|
||||
|
||||
# define at_canonical_name(at) ((at)->sat_cname)
|
||||
#else
|
||||
LIBSLAPD_F (int) at_fake_if_needed LDAP_P(( const char *name ));
|
||||
|
|
|
|||
Loading…
Reference in a new issue