X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fcontrols.c;h=52fae3b09028f2797f8097eabb1568c08dc6cd23;hb=a5ee438c9394a19a241716d3d922299c20b0365d;hp=b60af869aedefd72ff395a23eab36354503483c1;hpb=aad3c488da42b127cf9736570609e4ca06de5595;p=openldap diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index b60af869ae..52fae3b090 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -1,5 +1,6 @@ +/* $OpenLDAP$ */ /* - * Copyright 1999 The OpenLDAP Foundation. + * Copyright 1999-2000 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms are permitted only @@ -20,6 +21,7 @@ char *supportedControls[] = { LDAP_CONTROL_MANAGEDSAIT, +/* LDAP_CONTROL_X_CHANGE_PASSWD, */ NULL }; @@ -47,7 +49,7 @@ int get_ctrls( if(( tag = ber_peek_tag( ber, &len )) != LDAP_TAG_CONTROLS ) { if( tag == LBER_ERROR ) { - rc = -1; + rc = SLAPD_DISCONNECT; errmsg = "unexpected data in PDU"; } @@ -57,7 +59,7 @@ int get_ctrls( Debug( LDAP_DEBUG_TRACE, "=> get_ctrls\n", 0, 0, 0 ); if( op->o_protocol < LDAP_VERSION3 ) { - rc = -1; + rc = SLAPD_DISCONNECT; errmsg = "controls require LDAPv3"; goto return_results; } @@ -73,7 +75,7 @@ int get_ctrls( } #endif - ctrls[nctrls] = NULL; + *ctrls[nctrls] = NULL; for( tag = ber_first_element( ber, &len, &opaque ); tag != LBER_ERROR; @@ -119,7 +121,7 @@ int get_ctrls( 0, 0, 0 ); *ctrls = NULL; ldap_controls_free( tctrls ); - rc = -1; + rc = SLAPD_DISCONNECT; errmsg = "decoding controls error"; goto return_results; } @@ -135,7 +137,7 @@ int get_ctrls( 0, 0, 0 ); *ctrls = NULL; ldap_controls_free( tctrls ); - rc = -1; + rc = SLAPD_DISCONNECT; errmsg = "decoding controls error"; goto return_results; } @@ -157,7 +159,7 @@ int get_ctrls( 0, 0, 0 ); *ctrls = NULL; ldap_controls_free( tctrls ); - rc = -1; + rc = SLAPD_DISCONNECT; errmsg = "decoding controls error"; goto return_results; } @@ -179,7 +181,7 @@ return_results: nctrls, rc, errmsg ? errmsg : ""); if( sendres && rc != LDAP_SUCCESS ) { - if( rc == -1 ) { + if( rc == SLAPD_DISCONNECT ) { send_ldap_disconnect( conn, op, rc, errmsg ); } else { send_ldap_result( conn, op, rc,