]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema.c
Per ITS#419, don't require SLAPD_RLOOKUPS when HAVE_TCPD
[openldap] / servers / slapd / schema.c
index 0462243dabdd454b5c507dcbbdce25678d89cc7d..f5e32c07b48657ec8855f0f748b9a45f5b2edffb 100644 (file)
@@ -44,7 +44,7 @@ oc_schema_check( Entry *e )
        for ( i = 0; aoc->a_vals[i] != NULL; i++ ) {
                if ( (oc = oc_find( aoc->a_vals[i]->bv_val )) == NULL ) {
                        Debug( LDAP_DEBUG_ANY,
-                               "Objectclass \"%s\" not defined",
+                               "Objectclass \"%s\" not defined\n",
                                aoc->a_vals[i]->bv_val, 0, 0 );
                }
                else
@@ -164,6 +164,7 @@ static char *oc_operational_attrs[] = {
        "supportedControl",
        "supportedSASLMechanisms",
        "supportedLDAPversion",
+       "supportedACIMechanisms",
        "subschemaSubentry",            /* NO USER MOD */
        NULL
 
@@ -223,6 +224,7 @@ oc_check_allowed( char *type, struct berval **ocl )
        AttributeType   *at;
        int             i, j;
        char            **pp;
+       char            *p, *t;
 
        Debug( LDAP_DEBUG_TRACE,
               "oc_check_allowed type \"%s\"\n", type, 0, 0 );
@@ -241,6 +243,23 @@ oc_check_allowed( char *type, struct berval **ocl )
                return( 0 );
        }
 
+       /*
+        * The "type" we have received is actually an AttributeDescription.
+        * Let's find out the corresponding type.
+        */
+       p = strchr( type, ';' );
+       if ( p ) {
+               t = ch_malloc( p-type+1 );
+               strncpy( t, type, p-type );
+               t[p-type] = '\0';
+               Debug( LDAP_DEBUG_TRACE,
+                      "oc_check_allowed type \"%s\" from \"%s\"\n",
+                      t, type, 0 );
+
+       } else {
+               t = type;
+       }
+
        /* check that the type appears as req or opt in at least one oc */
        for ( i = 0; ocl[i] != NULL; i++ ) {
                /* if we know about the oc */
@@ -250,14 +269,18 @@ oc_check_allowed( char *type, struct berval **ocl )
                                oc->soc_required[j] != NULL; j++ ) {
                                at = oc->soc_required[j];
                                if ( at->sat_oid &&
-                                    strcmp(at->sat_oid, type ) == 0 ) {
+                                    strcmp(at->sat_oid, t ) == 0 ) {
+                                       if ( t != type )
+                                               ldap_memfree( t );
                                        return( 0 );
                                }
                                pp = at->sat_names;
                                if ( pp == NULL )
                                        continue;
                                while ( *pp ) {
-                                       if ( strcasecmp( *pp, type ) == 0 ) {
+                                       if ( strcasecmp( *pp, t ) == 0 ) {
+                                               if ( t != type )
+                                                       ldap_memfree( t );
                                                return( 0 );
                                        }
                                        pp++;
@@ -268,15 +291,19 @@ oc_check_allowed( char *type, struct berval **ocl )
                                oc->soc_allowed[j] != NULL; j++ ) {
                                at = oc->soc_allowed[j];
                                if ( at->sat_oid &&
-                                    strcmp(at->sat_oid, type ) == 0 ) {
+                                    strcmp( at->sat_oid, t ) == 0 ) {
+                                       if ( t != type )
+                                               ldap_memfree( t );
                                        return( 0 );
                                }
                                pp = at->sat_names;
                                if ( pp == NULL )
                                        continue;
                                while ( *pp ) {
-                                       if ( strcasecmp( *pp, type ) == 0 ||
+                                       if ( strcasecmp( *pp, t ) == 0 ||
                                             strcmp( *pp, "*" ) == 0 ) {
+                                               if ( t != type )
+                                                       ldap_memfree( t );
                                                return( 0 );
                                        }
                                        pp++;
@@ -284,12 +311,18 @@ oc_check_allowed( char *type, struct berval **ocl )
                        }
                        /* maybe the next oc allows it */
 
+#ifdef OC_UNDEFINED_IMPLES_EXTENSIBLE
                /* we don't know about the oc. assume it allows it */
                } else {
+                       if ( t != type )
+                               ldap_memfree( t );
                        return( 0 );
+#endif
                }
        }
 
+       if ( t != type )
+               ldap_memfree( t );
        /* not allowed by any oc */
        return( 1 );
 }
@@ -919,6 +952,7 @@ struct syntax_defs_rec syntax_defs[] = {
        {"( 1.3.6.1.4.1.1466.115.121.1.25 DESC 'Guide' )", NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.26 DESC 'IA5String' )", NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.27 DESC 'Integer' )", NULL},
+       {"( 1.3.6.1.4.1.1466.115.121.1.28 DESC 'JPEG' )", NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.30 DESC 'MatchingRuleDescription' )", NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.31 DESC 'MatchingRuleUseDescription' )", NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.32 DESC 'MailPreference' )", NULL},
@@ -1143,7 +1177,7 @@ schema_info( Connection *conn, Operation *op, char **attrs, int attrsonly )
        e->e_attrs = NULL;
        e->e_dn = ch_strdup( SLAPD_SCHEMA_DN );
        e->e_ndn = ch_strdup( SLAPD_SCHEMA_DN );
-       (void) dn_normalize_case( e->e_ndn );
+       (void) dn_normalize( e->e_ndn );
        e->e_private = NULL;
 
        {