Add place holder for handling LDAPv3 extended operations (coming soon).
*/
if ( ber_scanf( op->o_ber, "i", &id ) == LBER_ERROR ) {
- Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0 ,0 );
+ Debug( LDAP_DEBUG_ANY, "do_abandon: ber_scanf failed\n", 0, 0 ,0 );
return;
}
+#ifdef GET_CTRLS
+ if( get_ctrls( conn, op, 0 ) == -1 ) {
+ Debug( LDAP_DEBUG_ANY, "do_abandon: get_ctrls failed\n", 0, 0 ,0 );
+ return;
+ }
+#endif
+
Debug( LDAP_DEBUG_ARGS, "do_abandon: id %d\n", id, 0 ,0 );
/*
/* get the name */
if ( ber_scanf( ber, "{a", /*}*/ &dn ) == LBER_ERROR ) {
- Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
+ Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 );
send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL,
"decoding error" );
return;
ber_bvecfree( vals );
}
+ if ( ber_scanf( ber, /*{*/ "}") == LBER_ERROR ) {
+ entry_free( e );
+ Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 );
+ send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL,
+ "decoding error" );
+ return;
+ }
+
+#ifdef GET_CTRLS
+ if( get_ctrls( conn, op, 1 ) == -1 ) {
+ entry_free( e );
+ Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 );
+ return;
+ }
+#endif
+
Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d ADD dn=\"%s\"\n",
conn->c_connid, op->o_opid, e->e_ndn, 0, 0 );
return;
}
+#ifdef GET_CTRLS
+ if( get_ctrls( conn, op, 1 ) == -1 ) {
+ if ( cdn != NULL ) {
+ free( cdn );
+ }
+ if ( ndn != NULL ) {
+ free( ndn );
+ }
+ if ( cred.bv_val != NULL ) {
+ free( cred.bv_val );
+ }
+ Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 );
+ return;
+ }
+#endif
+
Debug( LDAP_DEBUG_TRACE, "do_bind: version %d dn (%s) method %d\n",
version, cdn, method );
send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL, "" );
return;
}
+
+#ifdef GET_CTRLS
+ if( get_ctrls( conn, op, 1 ) == -1 ) {
+ free( ndn );
+ ava_free( &ava, 0 );
+ Debug( LDAP_DEBUG_ANY, "do_compare: get_ctrls failed\n", 0, 0, 0 );
+ return;
+ }
+#endif
+
value_normalize( ava.ava_value.bv_val, attr_syntax( ava.ava_type ) );
Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
do_abandon( conn, arg->co_op );
break;
+#if 0
+ case LDAP_REQ_EXTENDED:
+ do_extended( conn, arg->co_op );
+ break;
+#endif
+
default:
Debug( LDAP_DEBUG_ANY, "unknown request 0x%lx\n",
arg->co_op->o_tag, 0, 0 );
return;
}
+#ifdef GET_CTRLS
+ if( get_ctrls( conn, op, 1 ) == -1 ) {
+ free( ndn );
+ Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 );
+ return;
+ }
+#endif
+
Debug( LDAP_DEBUG_ARGS, "do_delete: dn (%s)\n", ndn, 0, 0 );
dn_normalize_case( ndn );
}
#endif
+#ifdef GET_CTRLS
+ if( get_ctrls( conn, op, 1 ) == -1 ) {
+ free( ndn );
+ modlist_free( modlist );
+ Debug( LDAP_DEBUG_ANY, "do_modify: get_ctrls failed\n", 0, 0, 0 );
+ return;
+ }
+#endif
+
Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d MOD dn=\"%s\"\n",
conn->c_connid, op->o_opid, ndn, 0, 0 );
return;
}
- Debug( LDAP_DEBUG_ARGS,
- "do_modrdn: dn (%s) newrdn (%s) deloldrdn (%d)\n", ndn, newrdn,
- deloldrdn );
-
-
/* Check for newSuperior parameter, if present scan it */
if ( ber_peek_tag( op->o_ber, &length ) == LDAP_TAG_NEWSUPERIOR ) {
return;
}
- if ( ber_scanf( op->o_ber, /*{*/ "a}", &newSuperior )
+ if ( ber_scanf( op->o_ber, "a", &newSuperior )
== LBER_ERROR ) {
Debug( LDAP_DEBUG_ANY, "ber_scanf(\"a\"}) failed\n",
}
+ }
- Debug( LDAP_DEBUG_ARGS, "do_modrdn: newSuperior=(%s)\n",
- newSuperior, 0, 0 );
+ Debug( LDAP_DEBUG_ARGS,
+ "do_modrdn: dn (%s) newrdn (%s) newsuperior (%s)\n",
+ ndn, newrdn,
+ newSuperior != NULL ? newSuperior : "" );
+ if ( ber_scanf( op->o_ber, /*{*/ "}") == LBER_ERROR ) {
+ free( ndn );
+ free( newrdn );
+ free( newSuperior );
+ Debug( LDAP_DEBUG_ANY, "do_modrdn: ber_scanf failed\n", 0, 0, 0 );
+ send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL,
+ "decoding error" );
+ return;
+ }
+
+#ifdef GET_CTRLS
+ if( get_ctrls( conn, op, 1 ) == -1 ) {
+ free( ndn );
+ free( newrdn );
+ free( newSuperior );
+ Debug( LDAP_DEBUG_ANY, "do_modrdn: get_ctrls failed\n", 0, 0, 0 );
+ return;
+ }
+#endif
+
+ if( newSuperior != NULL ) {
/* GET BACKEND FOR NEW SUPERIOR */
nnewSuperior = strdup( newSuperior );
* XXX: We may need to do something else here, not sure
* what though.
*/
-
Debug( LDAP_DEBUG_ARGS,
"do_modrdn: cant find backend for=(%s)\n",
send_ldap_result( conn, op, LDAP_PARTIAL_RESULTS, NULL,
default_referral );
return;
-
}
-
}
dn_normalize_case( ndn );
char ** charray_dup LDAP_P(( char **a ));
char ** str2charray LDAP_P(( char *str, char *brkstr ));
+/*
+ * controls.c
+ */
+int get_ctrls LDAP_P((
+ Connection *co,
+ Operation *op,
+ int senderrors ));
+
/*
* config.c
*/
goto return_results;
}
+#ifdef GET_CTRLS
+ if( get_ctrls( conn, op, 1 ) == -1 ) {
+ Debug( LDAP_DEBUG_ANY, "do_search: get_ctrls failed\n", 0, 0, 0 );
+ goto return_results;
+ }
+#endif
+
Debug( LDAP_DEBUG_ARGS, " attrs:", 0, 0, 0 );
+
if ( attrs != NULL ) {
for ( i = 0; attrs[i] != NULL; i++ ) {
attr_normalize( attrs[i] );
Debug( LDAP_DEBUG_ARGS, " %s", attrs[i], 0, 0 );
}
}
+
Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 );
Statslog( LDAP_DEBUG_STATS,