From 683c237a54dd3c3ed7f4e40f65bd2be5d577e8df Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 29 Jan 2003 17:01:04 +0000 Subject: [PATCH] bail out is now the default; use noSuchAttribute as error code, as suggested by Kurt --- servers/slapd/add.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/servers/slapd/add.c b/servers/slapd/add.c index e5d7a1105e..952c6b4610 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -238,12 +238,11 @@ do_add( Connection *conn, Operation *op ) } if (mod == NULL) { +#define BAILOUT #ifdef BAILOUT - /* for now, bail out; we might end up - * adding the missing value, as iPlanet - * allegedly does */ + /* bail out */ send_ldap_result( conn, op, - rc = LDAP_CONSTRAINT_VIOLATION, + rc = LDAP_NO_SUCH_ATTRIBUTE, NULL, "attribute in RDN not listed in entry", NULL, NULL ); @@ -252,6 +251,7 @@ do_add( Connection *conn, Operation *op ) #else /* ! BAILOUT */ struct berval bv; + /* add attribute type and value to modlist */ mod = (Modifications *) ch_malloc( sizeof(Modifications) ); mod->sml_op = LDAP_MOD_ADD; @@ -299,15 +299,18 @@ do_add( Connection *conn, Operation *op ) /* not found? */ if (mod->sml_bvalues[ i ].bv_val == NULL) { #ifdef BAILOUT + /* bailout */ send_ldap_result( conn, op, - rc = LDAP_CONSTRAINT_VIOLATION, + rc = LDAP_NO_SUCH_ATTRIBUTE, NULL, "value in RDN not listed in entry", NULL, NULL ); goto done; + #else /* ! BAILOUT */ struct berval bv; + /* add attribute type and value to modlist */ ber_dupbv( &bv, &rdn[ 0 ][ a_cnt ]->la_value ); ber_bvarray_add( &mod->sml_bvalues, &bv ); continue; -- 2.39.5