]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/at.c
remove dbenv->lock_put() call from transaction-protected operations
[openldap] / servers / slapd / at.c
index 3bffc75ac54ccda13769c71ab1c98806ce13b9e9..911c46f8702d5a993233951d8e443d1abbd2d1c8 100644 (file)
@@ -235,7 +235,7 @@ at_insert(
                                 (AVL_DUP) avl_dup_error ) ) {
                        *err = sat->sat_oid;
                        ldap_memfree(air);
-                       return SLAP_SCHERR_DUP_ATTR;
+                       return SLAP_SCHERR_ATTR_DUP;
                }
                /* FIX: temporal consistency check */
                at_bvfind(&air->air_name);
@@ -253,7 +253,7 @@ at_insert(
                                         (AVL_DUP) avl_dup_error ) ) {
                                *err = *names;
                                ldap_memfree(air);
-                               return SLAP_SCHERR_DUP_ATTR;
+                               return SLAP_SCHERR_ATTR_DUP;
                        }
                        /* FIX: temporal consistency check */
                        at_bvfind(&air->air_name);
@@ -332,18 +332,15 @@ at_add(
        }
 
        if ( at->at_collective ) {
-#ifdef SLAP_COLLECTIVE
                if( at->at_usage ) {
                        /* collective attributes cannot be operational */
-                       return SLAP_SCHERR_NOT_SUPPORTED;
+                       return SLAP_SCHERR_ATTR_BAD_USAGE;
                }
+
                if( at->at_single_value ) {
                        /* collective attributes cannot be single-valued */
-                       return SLAP_SCHERR_NOT_SUPPORTED;
+                       return SLAP_SCHERR_ATTR_BAD_USAGE;
                }
-#else
-               return SLAP_SCHERR_NOT_SUPPORTED;
-#endif
        }
 
        sat = (AttributeType *) ch_calloc( 1, sizeof(AttributeType) );
@@ -371,6 +368,11 @@ at_add(
                        /* subtypes must have same usage as their SUP */
                        return SLAP_SCHERR_ATTR_BAD_USAGE;
                }
+
+               if ( sat->sat_flags & SLAP_AT_FINAL ) {
+                       /* cannot subtype a "final" attribute type */
+                       return SLAP_SCHERR_ATTR_BAD_SUP;
+               }
        }
 
        /*
@@ -467,6 +469,9 @@ at_schema_info( Entry *e )
                if ( ldap_attributetype2bv( &at->sat_atype, vals ) == NULL ) {
                        return -1;
                }
+
+               if( at->sat_flags & SLAP_AT_HIDE ) continue;
+
 #if 0
                Debug( LDAP_DEBUG_TRACE, "Merging at [%ld] %s\n",
                       (long) vals[0].bv_len, vals[0].bv_val, 0 );