]> git.sur5r.net Git - openldap/commitdiff
SLAPD_SCHEMA_NOT_COMPAT: add subtype aware is_at_syntax()
authorKurt Zeilenga <kurt@openldap.org>
Sun, 28 May 2000 19:15:37 +0000 (19:15 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 28 May 2000 19:15:37 +0000 (19:15 +0000)
servers/slapd/aclparse.c
servers/slapd/at.c
servers/slapd/proto-slap.h

index 81a1de981b1959ab16e98a24a4c8a409c63a0eeb..c46979fb5583398922e0475bd9b842abd2ddd301 100644 (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",
index e1a3f5f971192a7ebe1d5b750bc716d949bfb6f8..3271ed303ea89db5f564674e9dc1b1422c2f844f 100644 (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 )
index c1b268ed22b79158f1fa1f4f05f4feda55ceb6f0..d51f1f25f3504334900e3d61f312ccff56550aac 100644 (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 ));