data.ulen = data.dlen = sizeof(buf);
data.data = buf;
rc = cursor->c_get( cursor, &key, &data, DB_SET );
- if ( rc ) goto leave;
+ if ( rc ) goto finish;
eh.bv.bv_val = buf;
eh.bv.bv_len = data.size;
rc = entry_header( &eh );
- if ( rc ) goto leave;
+ if ( rc ) goto finish;
/* Get the size */
data.flags ^= DB_DBT_PARTIAL;
data.ulen = 0;
rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
- if ( rc != DB_BUFFER_SMALL ) goto leave;
+ if ( rc != DB_BUFFER_SMALL ) goto finish;
/* Allocate a block and retrieve the data */
off = eh.data - eh.bv.bv_val;
rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
-leave:
+finish:
cursor->c_close( cursor );
if( rc != 0 ) {
data.flags ^= DB_DBT_PARTIAL;
data.ulen = 0;
rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
- if ( rc != DB_BUFFER_SMALL ) goto leave;
+ if ( rc != DB_BUFFER_SMALL ) goto done;
/* Allocate a block and retrieve the data */
eh.bv.bv_len = eh.nvals * sizeof( struct berval ) + data.size;
eh.data += eoff;
rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
- if ( rc ) goto leave;
+ if ( rc ) goto done;
#ifdef SLAP_ZONE_ALLOC
/* FIXME: will add ctx later */
}
#endif
}
-leave:
+done:
return e;
}
e->e_dn, textbuf, 0 );
rc = LDAP_OBJECT_CLASS_VIOLATION;
- goto leave;
+ goto done;
}
if( sc->soc_kind != LDAP_SCHEMA_STRUCTURAL ) {
e->e_dn, textbuf, 0 );
rc = LDAP_OTHER;
- goto leave;
+ goto done;
}
got_soc:
e->e_dn, textbuf, 0 );
rc = LDAP_OBJECT_CLASS_VIOLATION;
- goto leave;
+ goto done;
}
*text = textbuf;
"unrecognized objectClass '%s'",
aoc->a_vals[0].bv_val );
rc = LDAP_OBJECT_CLASS_VIOLATION;
- goto leave;
+ goto done;
} else if ( sc != slap_schema.si_oc_glue && sc != oc ) {
snprintf( textbuf, textlen,
"from '%s' to '%s' not allowed",
asc->a_vals[0].bv_val, oc->soc_cname.bv_val );
rc = LDAP_NO_OBJECT_CLASS_MODS;
- goto leave;
+ goto done;
} else if ( sc == slap_schema.si_oc_glue ) {
sc = oc;
}
if ( !is_entry_glue ( e ) ) {
rc = entry_naming_check( e, manage, text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
- goto leave;
+ goto done;
}
} else {
/* Glue Entry */
e->e_dn, textbuf, 0 );
rc = LDAP_OBJECT_CLASS_VIOLATION;
- goto leave;
+ goto done;
}
if( cr->scr_required ) for( i=0; cr->scr_required[i]; i++ ) {
e->e_dn, textbuf, 0 );
rc = LDAP_OBJECT_CLASS_VIOLATION;
- goto leave;
+ goto done;
}
}
e->e_dn, textbuf, 0 );
rc = LDAP_OBJECT_CLASS_VIOLATION;
- goto leave;
+ goto done;
}
}
}
e->e_dn, textbuf, 0 );
rc = LDAP_OBJECT_CLASS_VIOLATION;
- goto leave;
+ goto done;
}
if ( oc->soc_check ) {
rc = (oc->soc_check)( op->o_bd, e, oc,
text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
- goto leave;
+ goto done;
}
}
e->e_dn, textbuf, 0 );
rc = LDAP_OBJECT_CLASS_VIOLATION;
- goto leave;
+ goto done;
}
}
e->e_dn, textbuf, 0 );
rc = LDAP_OBJECT_CLASS_VIOLATION;
- goto leave;
+ goto done;
}
}
e->e_dn, textbuf, 0 );
rc = LDAP_OBJECT_CLASS_VIOLATION;
- goto leave;
+ goto done;
}
if( oc == slap_schema.si_oc_extensibleObject ) {
if( extensible ) {
*text = NULL;
rc = LDAP_SUCCESS;
- goto leave;
+ goto done;
}
/* check that each attr in the entry is allowed by some oc */
"Entry (%s), %s\n",
e->e_dn, textbuf, 0 );
- goto leave;
+ goto done;
}
}
*text = NULL;
-leave:
+done:
slap_sl_free( socs, op->o_tmpmemctx );
return rc;
}