if( is_at_single_value( a->a_desc->ad_type ) &&
a->a_vals[1].bv_val != NULL )
{
- Debug(LDAP_DEBUG_ANY,
- "Entry (%s), attribute '%s' cannot have multiple values\n",
- e->e_dn, type );
+ snprintf( textbuf, textlen,
+ "attribute '%s' cannot have multiple values",
+ type );
+
+ Debug( LDAP_DEBUG_ANY,
+ "Entry (%s), %s\n",
+ e->e_dn, textbuf );
return LDAP_CONSTRAINT_VIOLATION;
}
sc = oc_bvfind( &asc->a_vals[0] );
if( sc == NULL ) {
- Debug(LDAP_DEBUG_ANY,
- "entry_check_schema(%s): unrecognized structuralObjectClass '%s'\n",
- e->e_dn, asc->a_vals[0].bv_val );
+ snprintf( textbuf, textlen,
+ "unrecognized structuralObjectClass '%s'",
+ asc->a_vals[0].bv_val );
+
+ Debug( LDAP_DEBUG_ANY,
+ "entry_check_schema(%s): %s\n",
+ e->e_dn, textbuf );
rc = LDAP_OBJECT_CLASS_VIOLATION;
goto done;
}
if( sc->soc_kind != LDAP_SCHEMA_STRUCTURAL ) {
- Debug(LDAP_DEBUG_ANY,
- "entry_check_schema(%s): structuralObjectClass '%s' is not STRUCTURAL\n",
- e->e_dn, asc->a_vals[0].bv_val );
+ snprintf( textbuf, textlen,
+ "structuralObjectClass '%s' is not STRUCTURAL",
+ asc->a_vals[0].bv_val );
+
+ Debug( LDAP_DEBUG_ANY,
+ "entry_check_schema(%s): %s\n",
+ e->e_dn, textbuf );
rc = LDAP_OTHER;
goto done;
got_soc:
if( !manage && sc->soc_obsolete ) {
- Debug(LDAP_DEBUG_ANY,
- "entry_check_schema(%s): structuralObjectClass '%s' is OBSOLETE\n",
- e->e_dn, asc->a_vals[0].bv_val );
+ snprintf( textbuf, textlen,
+ "structuralObjectClass '%s' is OBSOLETE",
+ asc->a_vals[0].bv_val );
+
+ Debug( LDAP_DEBUG_ANY,
+ "entry_check_schema(%s): %s\n",
+ e->e_dn, textbuf );
rc = LDAP_OBJECT_CLASS_VIOLATION;
goto done;
/* check that the entry has required attrs of the content rule */
if( cr ) {
if( !manage && cr->scr_obsolete ) {
- Debug(LDAP_DEBUG_ANY,
- "Entry (%s): content rule '%s' is obsolete\n",
- e->e_dn, ldap_contentrule2name(&cr->scr_crule) );
+ snprintf( textbuf, textlen,
+ "content rule '%s' is obsolete",
+ ldap_contentrule2name( &cr->scr_crule ));
+
+ Debug( LDAP_DEBUG_ANY,
+ "Entry (%s): %s\n",
+ e->e_dn, textbuf );
rc = LDAP_OBJECT_CLASS_VIOLATION;
goto done;
/* not there => schema violation */
if ( a == NULL ) {
- Debug(LDAP_DEBUG_ANY,
- "Entry (%s): content rule '%s' requires attribute '%s'\n",
- e->e_dn,
- ldap_contentrule2name(&cr->scr_crule),
- at->sat_cname.bv_val );
+ snprintf( textbuf, textlen,
+ "content rule '%s' requires attribute '%s'",
+ ldap_contentrule2name( &cr->scr_crule ),
+ at->sat_cname.bv_val );
+
+ Debug( LDAP_DEBUG_ANY,
+ "Entry (%s): %s\n",
+ e->e_dn, textbuf );
rc = LDAP_OBJECT_CLASS_VIOLATION;
goto done;
/* there => schema violation */
if ( a != NULL ) {
- Debug(LDAP_DEBUG_ANY,
- "Entry (%s): content rule '%s' precluded attribute '%s'\n",
- e->e_dn,
- ldap_contentrule2name(&cr->scr_crule),
- at->sat_cname.bv_val );
+ snprintf( textbuf, textlen,
+ "content rule '%s' precluded attribute '%s'",
+ ldap_contentrule2name( &cr->scr_crule ),
+ at->sat_cname.bv_val );
+
+ Debug( LDAP_DEBUG_ANY,
+ "Entry (%s): %s\n",
+ e->e_dn, textbuf );
rc = LDAP_OBJECT_CLASS_VIOLATION;
goto done;
oc = socs[i];
if ( !manage && oc->soc_obsolete ) {
/* disallow obsolete classes */
- Debug(LDAP_DEBUG_ANY,
- "entry_check_schema(%s): objectClass '%s' is OBSOLETE\n",
- e->e_dn, aoc->a_vals[i].bv_val );
+ snprintf( textbuf, textlen,
+ "objectClass '%s' is OBSOLETE",
+ aoc->a_vals[i].bv_val );
+
+ Debug( LDAP_DEBUG_ANY,
+ "entry_check_schema(%s): %s\n",
+ e->e_dn, textbuf );
rc = LDAP_OBJECT_CLASS_VIOLATION;
goto done;
}
if( xc != NULL ) {
- Debug(LDAP_DEBUG_ANY,
- "entry_check_schema(%s): instantiation of " "abstract objectClass '%s' not allowed\n",
- e->e_dn, aoc->a_vals[i].bv_val );
+ snprintf( textbuf, textlen, "instantiation of "
+ "abstract objectClass '%s' not allowed",
+ aoc->a_vals[i].bv_val );
+
+ Debug( LDAP_DEBUG_ANY,
+ "entry_check_schema(%s): %s\n",
+ e->e_dn, textbuf );
rc = LDAP_OBJECT_CLASS_VIOLATION;
goto done;
s = oc_check_required( e, oc, &aoc->a_vals[i] );
if (s != NULL) {
- Debug(LDAP_DEBUG_ANY,
- "Entry (%s): object class '%s' requires attribute '%s'\n",
- e->e_dn, aoc->a_vals[i].bv_val, s );
+ snprintf( textbuf, textlen,
+ "object class '%s' requires attribute '%s'",
+ aoc->a_vals[i].bv_val, s );
+
+ Debug( LDAP_DEBUG_ANY,
+ "Entry (%s): %s\n",
+ e->e_dn, textbuf );
rc = LDAP_OBJECT_CLASS_VIOLATION;
goto done;
if ( rc != LDAP_SUCCESS ) {
char *type = a->a_desc->ad_cname.bv_val;
- Debug(LDAP_DEBUG_ANY,
- "Entry (%s), attribute '%s' not allowed\n",
- e->e_dn, type );
+ snprintf( textbuf, textlen,
+ "attribute '%s' not allowed",
+ type );
+
+ Debug( LDAP_DEBUG_ANY,
+ "Entry (%s), %s\n",
+ e->e_dn, textbuf );
goto done;
}