mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
bail out is now the default; use noSuchAttribute as error code, as suggested by Kurt
This commit is contained in:
parent
6b5611cbac
commit
683c237a54
@ -238,12 +238,11 @@ do_add( Connection *conn, Operation *op )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mod == NULL) {
|
if (mod == NULL) {
|
||||||
|
#define BAILOUT
|
||||||
#ifdef BAILOUT
|
#ifdef BAILOUT
|
||||||
/* for now, bail out; we might end up
|
/* bail out */
|
||||||
* adding the missing value, as iPlanet
|
|
||||||
* allegedly does */
|
|
||||||
send_ldap_result( conn, op,
|
send_ldap_result( conn, op,
|
||||||
rc = LDAP_CONSTRAINT_VIOLATION,
|
rc = LDAP_NO_SUCH_ATTRIBUTE,
|
||||||
NULL,
|
NULL,
|
||||||
"attribute in RDN not listed in entry",
|
"attribute in RDN not listed in entry",
|
||||||
NULL, NULL );
|
NULL, NULL );
|
||||||
@ -252,6 +251,7 @@ do_add( Connection *conn, Operation *op )
|
|||||||
#else /* ! BAILOUT */
|
#else /* ! BAILOUT */
|
||||||
struct berval bv;
|
struct berval bv;
|
||||||
|
|
||||||
|
/* add attribute type and value to modlist */
|
||||||
mod = (Modifications *) ch_malloc( sizeof(Modifications) );
|
mod = (Modifications *) ch_malloc( sizeof(Modifications) );
|
||||||
|
|
||||||
mod->sml_op = LDAP_MOD_ADD;
|
mod->sml_op = LDAP_MOD_ADD;
|
||||||
@ -299,15 +299,18 @@ do_add( Connection *conn, Operation *op )
|
|||||||
/* not found? */
|
/* not found? */
|
||||||
if (mod->sml_bvalues[ i ].bv_val == NULL) {
|
if (mod->sml_bvalues[ i ].bv_val == NULL) {
|
||||||
#ifdef BAILOUT
|
#ifdef BAILOUT
|
||||||
|
/* bailout */
|
||||||
send_ldap_result( conn, op,
|
send_ldap_result( conn, op,
|
||||||
rc = LDAP_CONSTRAINT_VIOLATION,
|
rc = LDAP_NO_SUCH_ATTRIBUTE,
|
||||||
NULL,
|
NULL,
|
||||||
"value in RDN not listed in entry",
|
"value in RDN not listed in entry",
|
||||||
NULL, NULL );
|
NULL, NULL );
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
#else /* ! BAILOUT */
|
#else /* ! BAILOUT */
|
||||||
struct berval bv;
|
struct berval bv;
|
||||||
|
|
||||||
|
/* add attribute type and value to modlist */
|
||||||
ber_dupbv( &bv, &rdn[ 0 ][ a_cnt ]->la_value );
|
ber_dupbv( &bv, &rdn[ 0 ][ a_cnt ]->la_value );
|
||||||
ber_bvarray_add( &mod->sml_bvalues, &bv );
|
ber_bvarray_add( &mod->sml_bvalues, &bv );
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user