Skip to content
Snippets Groups Projects
Commit e3b93c75 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Import str2ad error text bug

parent c0de0686
No related branches found
No related tags found
No related merge requests found
...@@ -70,6 +70,7 @@ do_modify( ...@@ -70,6 +70,7 @@ do_modify(
if ( ber_scanf( op->o_ber, "{a" /*}*/, &dn ) == LBER_ERROR ) { if ( ber_scanf( op->o_ber, "{a" /*}*/, &dn ) == LBER_ERROR ) {
Debug( LDAP_DEBUG_ANY, "do_modify: ber_scanf failed\n", 0, 0, 0 ); Debug( LDAP_DEBUG_ANY, "do_modify: ber_scanf failed\n", 0, 0, 0 );
send_ldap_disconnect( conn, op, send_ldap_disconnect( conn, op,
LDAP_PROTOCOL_ERROR, "decoding error" ); LDAP_PROTOCOL_ERROR, "decoding error" );
return SLAPD_DISCONNECT; return SLAPD_DISCONNECT;
...@@ -77,6 +78,7 @@ do_modify( ...@@ -77,6 +78,7 @@ do_modify(
Debug( LDAP_DEBUG_ARGS, "do_modify: dn (%s)\n", dn, 0, 0 ); Debug( LDAP_DEBUG_ARGS, "do_modify: dn (%s)\n", dn, 0, 0 );
/* collect modifications & save for later */ /* collect modifications & save for later */
for ( tag = ber_first_element( op->o_ber, &len, &last ); for ( tag = ber_first_element( op->o_ber, &len, &last );
...@@ -103,6 +105,7 @@ do_modify( ...@@ -103,6 +105,7 @@ do_modify(
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"do_modify: modify/add operation (%ld) requires values\n", "do_modify: modify/add operation (%ld) requires values\n",
(long) mop, 0, 0 ); (long) mop, 0, 0 );
send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR,
NULL, "modify/add operation requires values", NULL, "modify/add operation requires values",
NULL, NULL ); NULL, NULL );
...@@ -120,6 +123,7 @@ do_modify( ...@@ -120,6 +123,7 @@ do_modify(
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"do_modify: invalid modify operation (%ld)\n", "do_modify: invalid modify operation (%ld)\n",
(long) mop, 0, 0 ); (long) mop, 0, 0 );
send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR,
NULL, "unrecognized modify operation", NULL, NULL ); NULL, "unrecognized modify operation", NULL, NULL );
rc = LDAP_PROTOCOL_ERROR; rc = LDAP_PROTOCOL_ERROR;
...@@ -134,6 +138,7 @@ do_modify( ...@@ -134,6 +138,7 @@ do_modify(
if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "do_modify: get_ctrls failed\n", 0, 0, 0 ); Debug( LDAP_DEBUG_ANY, "do_modify: get_ctrls failed\n", 0, 0, 0 );
goto cleanup; goto cleanup;
} }
...@@ -141,6 +146,7 @@ do_modify( ...@@ -141,6 +146,7 @@ do_modify(
if( dn_normalize( ndn ) == NULL ) { if( dn_normalize( ndn ) == NULL ) {
Debug( LDAP_DEBUG_ANY, "do_modify: invalid dn (%s)\n", dn, 0, 0 ); Debug( LDAP_DEBUG_ANY, "do_modify: invalid dn (%s)\n", dn, 0, 0 );
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL, send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL ); "invalid DN", NULL, NULL );
goto cleanup; goto cleanup;
...@@ -148,6 +154,7 @@ do_modify( ...@@ -148,6 +154,7 @@ do_modify(
if( ndn == '\0' ) { if( ndn == '\0' ) {
Debug( LDAP_DEBUG_ANY, "do_modify: root dse!\n", 0, 0, 0 ); Debug( LDAP_DEBUG_ANY, "do_modify: root dse!\n", 0, 0, 0 );
send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM, send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "modify upon the root DSE not supported", NULL, NULL ); NULL, "modify upon the root DSE not supported", NULL, NULL );
goto cleanup; goto cleanup;
...@@ -155,11 +162,13 @@ do_modify( ...@@ -155,11 +162,13 @@ do_modify(
#ifdef LDAP_DEBUG #ifdef LDAP_DEBUG
Debug( LDAP_DEBUG_ARGS, "modifications:\n", 0, 0, 0 ); Debug( LDAP_DEBUG_ARGS, "modifications:\n", 0, 0, 0 );
for ( tmp = modlist; tmp != NULL; tmp = tmp->ml_next ) { for ( tmp = modlist; tmp != NULL; tmp = tmp->ml_next ) {
Debug( LDAP_DEBUG_ARGS, "\t%s: %s\n", Debug( LDAP_DEBUG_ARGS, "\t%s: %s\n",
tmp->ml_op == LDAP_MOD_ADD tmp->ml_op == LDAP_MOD_ADD
? "add" : (tmp->ml_op == LDAP_MOD_DELETE ? "add" : (tmp->ml_op == LDAP_MOD_DELETE
? "delete" : "replace"), tmp->ml_type, 0 ); ? "delete" : "replace"), tmp->ml_type, 0 );
} }
#endif #endif
...@@ -288,7 +297,8 @@ int slap_modlist2mods( ...@@ -288,7 +297,8 @@ int slap_modlist2mods(
int update, int update,
Modifications **mods, Modifications **mods,
const char **text, const char **text,
char *textbuf, size_t textlen ) char *textbuf,
size_t textlen )
{ {
int rc; int rc;
Modifications **modtail = mods; Modifications **modtail = mods;
...@@ -308,7 +318,8 @@ int slap_modlist2mods( ...@@ -308,7 +318,8 @@ int slap_modlist2mods(
if( rc != LDAP_SUCCESS ) { if( rc != LDAP_SUCCESS ) {
slap_mods_free( mod ); slap_mods_free( mod );
snprintf( textbuf, textlen, "%s: %s", ml->ml_type, text ); snprintf( textbuf, textlen, "%s: %s",
ml->ml_type, *text );
*text = textbuf; *text = textbuf;
return rc; return rc;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment