Commit af5f617d authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

cleanup

parent 519faf22
......@@ -133,7 +133,8 @@ do_add( Operation *op, SlapReply *rs )
Debug( LDAP_DEBUG_ANY, "no values for type %s\n",
tmp.sml_type.bv_val, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "no values for attribute type" );
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
"no values for attribute type" );
goto done;
}
......@@ -172,7 +173,8 @@ do_add( Operation *op, SlapReply *rs )
}
if ( modlist == NULL ) {
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "no attributes provided" );
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
"no attributes provided" );
goto done;
}
......@@ -181,11 +183,13 @@ do_add( Operation *op, SlapReply *rs )
if( e->e_nname.bv_len == 0 ) {
/* protocolError may be a more appropriate error */
send_ldap_error( op, rs, LDAP_ALREADY_EXISTS, "root DSE already exists" );
send_ldap_error( op, rs, LDAP_ALREADY_EXISTS,
"root DSE already exists" );
goto done;
} else if ( bvmatch( &e->e_nname, &global_schemandn ) ) {
send_ldap_error( op, rs, LDAP_ALREADY_EXISTS, "subschema subentry already exists" );
send_ldap_error( op, rs, LDAP_ALREADY_EXISTS,
"subschema subentry already exists" );
goto done;
}
......@@ -205,7 +209,9 @@ do_add( Operation *op, SlapReply *rs )
rs->sr_err = LDAP_REFERRAL;
send_ldap_result( op, rs );
if ( rs->sr_ref != default_referral ) ber_bvarray_free( rs->sr_ref );
if ( rs->sr_ref != default_referral ) {
ber_bvarray_free( rs->sr_ref );
}
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"referral missing" );
......@@ -337,9 +343,9 @@ do_add( Operation *op, SlapReply *rs )
#ifdef LDAP_SLAPI
rs->sr_err = doPreAddPluginFNs( op );
if ( rs->sr_err != LDAP_SUCCESS ) {
/* plugin will have sent result */
goto done;
}
/* plugin will have sent result */
goto done;
}
#endif
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO,
......@@ -348,7 +354,7 @@ do_add( Operation *op, SlapReply *rs )
Debug( LDAP_DEBUG_ARGS, " do_add: no backend support\n", 0, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"operation not supported within namingContext" );
"operation not supported within namingContext" );
}
#ifdef LDAP_SLAPI
......
......@@ -150,7 +150,8 @@ do_modify(
default: {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"do_modify: invalid modify operation (%ld)\n", (long)mop, 0, 0 );
"do_modify: invalid modify operation (%ld)\n",
(long)mop, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"do_modify: invalid modify operation (%ld)\n",
......@@ -177,7 +178,8 @@ do_modify(
goto cleanup;
}
rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
op->o_tmpmemctx );
if( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_modify: conn %d invalid dn (%s)\n",
......@@ -296,7 +298,8 @@ do_modify(
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
if ( (op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 0 )) == NULL ) {
op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 0 );
if ( op->o_bd == NULL ) {
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
if (!rs->sr_ref) rs->sr_ref = default_referral;
......@@ -628,7 +631,9 @@ int slap_mods_check(
if( nvals && ad->ad_type->sat_equality &&
ad->ad_type->sat_equality->smr_normalize )
{
ml->sml_nvalues = ber_memalloc_x( (nvals+1)*sizeof(struct berval), ctx );
ml->sml_nvalues = ber_memalloc_x(
(nvals+1)*sizeof(struct berval), ctx );
for( nvals = 0; ml->sml_values[nvals].bv_val; nvals++ ) {
rc = ad->ad_type->sat_equality->smr_normalize(
0,
......@@ -652,6 +657,7 @@ int slap_mods_check(
return rc;
}
}
ml->sml_nvalues[nvals].bv_val = NULL;
ml->sml_nvalues[nvals].bv_len = 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment