Diff for /servers/slapd/schema_check.c between versions 1.103.2.8 and 1.103.2.9

version 1.103.2.8, 2009/01/22 00:01:03 version 1.103.2.9, 2009/02/05 19:35:54
Line 1 Line 1
 /* schema_check.c - routines to enforce schema definitions */  /* schema_check.c - routines to enforce schema definitions */
 /* $OpenLDAP: pkg/ldap/servers/slapd/schema_check.c,v 1.103.2.7 2008/11/19 20:11:21 quanah Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/schema_check.c,v 1.103.2.8 2009/01/22 00:01:03 kurt Exp $ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
  * Copyright 1998-2009 The OpenLDAP Foundation.   * Copyright 1998-2009 The OpenLDAP Foundation.
Line 49  entry_schema_check( Line 49  entry_schema_check(
         Attribute *oldattrs,          Attribute *oldattrs,
         int manage,          int manage,
         int add,          int add,
           Attribute **socp,
         const char** text,          const char** text,
         char *textbuf, size_t textlen )          char *textbuf, size_t textlen )
 {  {
Line 212  got_soc: Line 213  got_soc:
                 rc = LDAP_OBJECT_CLASS_VIOLATION;                  rc = LDAP_OBJECT_CLASS_VIOLATION;
                 goto done;                  goto done;
   
         } else if ( sc != slap_schema.si_oc_glue && sc != oc ) {          } else if ( sc != oc ) {
                 snprintf( textbuf, textlen,                   if ( !manage && sc != slap_schema.si_oc_glue ) {
                         "structural object class modification "                          snprintf( textbuf, textlen, 
                         "from '%s' to '%s' not allowed",                                  "structural object class modification "
                         asc->a_vals[0].bv_val, oc->soc_cname.bv_val );                                  "from '%s' to '%s' not allowed",
                 rc = LDAP_NO_OBJECT_CLASS_MODS;                                  asc->a_vals[0].bv_val, oc->soc_cname.bv_val );
                 goto done;                          rc = LDAP_NO_OBJECT_CLASS_MODS;
         } else if ( sc == slap_schema.si_oc_glue ) {                          goto done;
                   }
   
                   assert( asc->a_vals != NULL );
                   assert( !BER_BVISNULL( &asc->a_vals[0] ) );
                   assert( BER_BVISNULL( &asc->a_vals[1] ) );
                   assert( asc->a_nvals == asc->a_vals );
   
                   /* draft-zeilenga-ldap-relax: automatically modify
                    * structuralObjectClass if changed with relax */
                 sc = oc;                  sc = oc;
                   ber_bvreplace( &asc->a_vals[ 0 ], &sc->soc_cname );
                   if ( socp ) {
                           *socp = asc;
                   }
         }          }
   
         /* naming check */          /* naming check */

Removed from v.1.103.2.8  
changed lines
  Added in v.1.103.2.9


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org