X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fmodify.c;h=0f0c716375f167e6de35b1ba47d6d786746912de;hb=69343add5ac17c2300e256c85acf3279298a0fbe;hp=026678a9ad129f4d18557898cd8dc1ea6fcc29f0;hpb=b6620f3d257cde631649e77e39f7b15f87ab6b4f;p=openldap diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 026678a9ad..0f0c716375 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -204,8 +204,7 @@ do_modify( NULL, "modify upon the root DSE not supported", NULL, NULL ); goto cleanup; -#if defined( SLAPD_SCHEMA_DN ) - } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) { + } else if ( bvmatch( &ndn, &global_schemandn ) ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ERR, "do_modify: attempt to modify subschema subentry.\n" , 0, 0, 0 ); @@ -217,7 +216,6 @@ do_modify( NULL, "modification of subschema subentry not supported", NULL, NULL ); goto cleanup; -#endif } #ifdef LDAP_DEBUG @@ -547,8 +545,8 @@ int slap_mods_opattrs( char *textbuf, size_t textlen ) { struct berval name, timestamp, csn; - char timebuf[22]; - char csnbuf[64]; + char timebuf[ LDAP_LUTIL_GENTIME_BUFSIZE ]; + char csnbuf[ LDAP_LUTIL_CSNSTR_BUFSIZE ]; Modifications *mod; int mop = op->o_tag == LDAP_REQ_ADD @@ -589,22 +587,21 @@ int slap_mods_opattrs( if( rc != LDAP_SUCCESS ) { return rc; } - if ( tmpval.bv_len ) { - mod = (Modifications *) ch_malloc( sizeof( Modifications ) ); - mod->sml_op = mop; - mod->sml_type.bv_val = NULL; - mod->sml_desc = slap_schema.si_ad_structuralObjectClass; - mod->sml_bvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) ); - ber_dupbv( &mod->sml_bvalues[0], &tmpval ); - mod->sml_bvalues[1].bv_val = NULL; - assert( mod->sml_bvalues[0].bv_val ); - *modtail = mod; - modtail = &mod->sml_next; - } + + mod = (Modifications *) ch_malloc( sizeof( Modifications ) ); + mod->sml_op = mop; + mod->sml_type.bv_val = NULL; + mod->sml_desc = slap_schema.si_ad_structuralObjectClass; + mod->sml_bvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) ); + ber_dupbv( &mod->sml_bvalues[0], &tmpval ); + mod->sml_bvalues[1].bv_val = NULL; + assert( mod->sml_bvalues[0].bv_val ); + *modtail = mod; + modtail = &mod->sml_next; } if( SLAP_LASTMOD(be) ) { - char uuidbuf[40]; + char uuidbuf[ LDAP_LUTIL_UUIDSTR_BUFSIZE ]; tmpval.bv_len = lutil_uuidstr( uuidbuf, sizeof( uuidbuf ) ); tmpval.bv_val = uuidbuf;