SLAPD_SCHEMA_NOT_COMPAT: add subtype aware is_at_syntax()

This commit is contained in:
Kurt Zeilenga 2000-05-28 19:15:37 +00:00
parent c98f0ea02c
commit 229e12b69d
3 changed files with 21 additions and 4 deletions

View file

@ -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",

View file

@ -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 )

View file

@ -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 ));