X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Foc.c;h=3ba9501db39cea3f71c32f17f830b25ba21cf897;hb=e841247c9086053d774d66e4fbb058d0ead706b2;hp=8f1bd67ebc5107cb2ae6df5ca28ae4e729e3db00;hpb=c890c96d13c53cf0fa1d9580fea2ab47a2c8caa9;p=openldap diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index 8f1bd67ebc..3ba9501db3 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2008 The OpenLDAP Foundation. + * Copyright 1998-2009 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,6 +92,9 @@ int is_entry_objectclass( e->e_dn == NULL ? "" : e->e_dn, oc->soc_oclass.oc_oid, 0 ); + /* mark flags as set */ + e->e_ocflags |= SLAP_OC__END; + return 0; } @@ -227,6 +230,10 @@ oc_bvfind_undef( struct berval *ocname ) oc->soc_cname.bv_len = ocname->bv_len; oc->soc_cname.bv_val = (char *)&oc[ 1 ]; AC_MEMCPY( oc->soc_cname.bv_val, ocname->bv_val, ocname->bv_len ); + oc->soc_cname.bv_val[ oc->soc_cname.bv_len ] = '\0'; + + /* canonical to upper case */ + ldap_pvt_str2upper( oc->soc_cname.bv_val ); LDAP_STAILQ_NEXT( oc, soc_next ) = NULL; ldap_pvt_thread_mutex_lock( &oc_undef_mutex ); @@ -502,6 +509,10 @@ oc_next( ObjectClass **oc ) } #endif + if ( *oc == NULL ) { + return 0; + } + *oc = LDAP_STAILQ_NEXT(*oc,soc_next); return (*oc != NULL); @@ -892,7 +903,7 @@ oc_schema_info( Entry *e ) } int -register_oc( char *def, ObjectClass **soc, int dupok ) +register_oc( const char *def, ObjectClass **soc, int dupok ) { LDAPObjectClass *oc; int code;