LDAPModList *modlist = NULL;
LDAPModList **modtail = &modlist;
Modifications *mods = NULL;
- char *text;
#endif
+ char *text;
int rc = LDAP_SUCCESS;
Debug( LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 );
}
/* make sure this backend recongizes critical controls */
- rc = backend_check_controls( be, conn, op ) ;
+ rc = backend_check_controls( be, conn, op, &text ) ;
if( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc,
- NULL, NULL, NULL, NULL );
+ NULL, text, NULL, NULL );
goto done;
}
#endif
if( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc,
- NULL, text,
- NULL, NULL );
+ NULL, text, NULL, NULL );
goto done;
}
}
/* modify indexes */
if ( index_add_mods( be, modlist, e->e_id ) != 0 ) {
/* our indices are likely hosed */
- return LDAP_OPERATIONS_ERROR;
+ return LDAP_OTHER;
}
return LDAP_SUCCESS;
/* change the entry itself */
if ( id2entry_add( be, e ) != 0 ) {
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ send_ldap_result( conn, op, LDAP_OTHER,
NULL, NULL, NULL, NULL );
goto error_return;
}
if( (p = dn2entry_w( be, p_ndn, NULL )) == NULL) {
Debug( LDAP_DEBUG_TRACE, "parent does not exist\n",
0, 0, 0);
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ send_ldap_result( conn, op, LDAP_OTHER,
NULL, NULL, NULL, NULL );
goto return_results;
}
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: newSup(ndn=%s) not here!\n",
np_ndn, 0, 0);
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ send_ldap_result( conn, op, LDAP_OTHER,
NULL, NULL, NULL, NULL );
goto return_results;
}
/* delete old one */
if ( dn2id_delete( be, e->e_ndn, e->e_id ) != 0 ) {
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ send_ldap_result( conn, op, LDAP_OTHER,
NULL, NULL, NULL, NULL );
goto return_results;
}
/* add new one */
if ( dn2id_add( be, e->e_ndn, e->e_id ) != 0 ) {
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ send_ldap_result( conn, op, LDAP_OTHER,
NULL, NULL, NULL, NULL );
goto return_results;
}
/* id2entry index */
if ( id2entry_add( be, e ) != 0 ) {
entry_free( e );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ send_ldap_result( conn, op, LDAP_OTHER,
NULL, NULL, NULL, NULL );
goto return_results;
}
new = slap_passwd_generate();
if( new == NULL || new->bv_len == 0 ) {
- *text = ch_strdup("password generation failed.");
+ *text = "password generation failed.";
rc = LDAP_OPERATIONS_ERROR;
goto done;
}
backend_check_controls(
Backend *be,
Connection *conn,
- Operation *op )
+ Operation *op,
+ char **text )
{
LDAPControl **ctrls;
ctrls = op->o_ctrls;
if( (*ctrls)->ldctl_iscritical &&
!charray_inlist( be->be_controls, (*ctrls)->ldctl_oid ) )
{
+ *text = "control unavailable in NamingContext";
return LDAP_UNAVAILABLE_CRITICAL_EXTENSION;
}
}
char *ndn;
ber_tag_t tag;
int rc = LDAP_SUCCESS;
+ char *text;
struct berval cred;
Backend *be;
conn->c_authz_backend = be;
/* make sure this backend recongizes critical controls */
- rc = backend_check_controls( be, conn, op ) ;
+ rc = backend_check_controls( be, conn, op, &text ) ;
if( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc,
- NULL, NULL, NULL, NULL );
+ NULL, text, NULL, NULL );
goto cleanup;
}
#else
Ava ava;
#endif
+ char *text;
desc.bv_val = NULL;
value.bv_val = NULL;
}
/* make sure this backend recongizes critical controls */
- rc = backend_check_controls( be, conn, op ) ;
+ rc = backend_check_controls( be, conn, op, &text ) ;
if( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc,
- NULL, NULL, NULL, NULL );
+ NULL, text, NULL, NULL );
goto cleanup;
}
Operation *op
)
{
- char *dn, *ndn;
+ char *dn, *ndn, *text;
Backend *be;
int rc;
}
/* make sure this backend recongizes critical controls */
- rc = backend_check_controls( be, conn, op ) ;
+ rc = backend_check_controls( be, conn, op, &text ) ;
if( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc,
- NULL, NULL, NULL, NULL );
+ NULL, text, NULL, NULL );
goto cleanup;
}
Modifications *mods = NULL;
Backend *be;
int rc;
+ char *text;
Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 );
}
/* make sure this backend recongizes critical controls */
- rc = backend_check_controls( be, conn, op ) ;
+ rc = backend_check_controls( be, conn, op, &text ) ;
if( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc,
- NULL, NULL, NULL, NULL );
+ NULL, text, NULL, NULL );
goto cleanup;
}
Backend *newSuperior_be = NULL;
ber_len_t length;
int rc;
+ char *text;
Debug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 );
Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid new superior (%s)\n",
newSuperior, 0, 0 );
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
- "invalid (new superior) DN", NULL, NULL );
+ "new superior invalid", NULL, NULL );
goto cleanup;
}
}
/* make sure this backend recongizes critical controls */
- rc = backend_check_controls( be, conn, op ) ;
+ rc = backend_check_controls( be, conn, op, &text ) ;
if( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc,
- NULL, NULL, NULL, NULL );
+ NULL, text, NULL, NULL );
goto cleanup;
}
rc = LDAP_AFFECTS_MULTIPLE_DSAS;
send_ldap_result( conn, op, rc,
- NULL, NULL, NULL, NULL );
+ NULL, "cannot rename between DSAa", NULL, NULL );
goto cleanup;
}
LIBSLAPD_F( int ) backend_check_controls LDAP_P((
Backend *be,
Connection *conn,
- Operation *op ));
+ Operation *op,
+ char **text ));
LIBSLAPD_F (int) backend_connection_init LDAP_P((Connection *conn));
LIBSLAPD_F (int) backend_connection_destroy LDAP_P((Connection *conn));
if ( ber == NULL ) {
Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
- NULL, "allocating BER error", NULL, NULL );
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "BER allocation error", NULL, NULL );
goto error_return;
}
if ( rc == -1 ) {
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
ber_free( ber, 1 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
- NULL, "encoding dn error", NULL, NULL );
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "encoding DN error", NULL, NULL );
goto error_return;
}
if (( rc = ber_printf( ber, "{s[" /*]}*/ , desc )) == -1 ) {
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
ber_free( ber, 1 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
- NULL, "encoding type error", NULL, NULL );
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "encoding description error", NULL, NULL );
goto error_return;
}
Debug( LDAP_DEBUG_ANY,
"ber_printf failed\n", 0, 0, 0 );
ber_free( ber, 1 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
- NULL, "encoding value error", NULL, NULL );
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "encoding values error", NULL, NULL );
goto error_return;
}
}
if (( rc = ber_printf( ber, /*{[*/ "]}" )) == -1 ) {
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
ber_free( ber, 1 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ send_ldap_result( conn, op, LDAP_OTHER,
NULL, "encode end error", NULL, NULL );
goto error_return;
}
if (( rc = ber_printf( ber, "{s[" /*]}*/ , desc )) == -1 ) {
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
ber_free( ber, 1 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
- NULL, "encoding type error", NULL, NULL );
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "encoding description error", NULL, NULL );
goto error_return;
}
Debug( LDAP_DEBUG_ANY,
"ber_printf failed\n", 0, 0, 0 );
ber_free( ber, 1 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
- NULL, "encoding value error", NULL, NULL );
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "encoding values error", NULL, NULL );
goto error_return;
}
}
if (( rc = ber_printf( ber, /*{[*/ "]}" )) == -1 ) {
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
ber_free( ber, 1 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ send_ldap_result( conn, op, LDAP_OTHER,
NULL, "encode end error", NULL, NULL );
goto error_return;
}
if ( rc == -1 ) {
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
ber_free( ber, 1 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ send_ldap_result( conn, op, LDAP_OTHER,
NULL, "encode entry end error", NULL, NULL );
return( 1 );
}
if ( ber == NULL ) {
Debug( LDAP_DEBUG_ANY,
"send_search_reference: ber_alloc failed\n", 0, 0, 0 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ send_ldap_result( conn, op, LDAP_OTHER,
NULL, "alloc BER error", NULL, NULL );
return -1;
}
Debug( LDAP_DEBUG_ANY,
"send_search_reference: ber_printf failed\n", 0, 0, 0 );
ber_free( ber, 1 );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
- NULL, "encode dn error", NULL, NULL );
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "encode DN error", NULL, NULL );
return -1;
}
{
/* Out of memory, do something about it */
entry_free( e );
- send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
- NULL, NULL, NULL, NULL );
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "out of memory", NULL, NULL );
return;
}
}
/* make sure this backend recongizes critical controls */
- rc = backend_check_controls( be, conn, op ) ;
+ rc = backend_check_controls( be, conn, op, &text ) ;
if( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc,
- NULL, NULL, NULL, NULL );
+ NULL, text, NULL, NULL );
goto return_results;
}