]> git.sur5r.net Git - openldap/commitdiff
fix request controls
authorPierangelo Masarati <ando@openldap.org>
Tue, 4 Jan 2011 00:10:02 +0000 (00:10 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 4 Jan 2011 00:10:02 +0000 (00:10 +0000)
contrib/slapd-modules/vc/vc.c

index 6fdb7b8a5f07e8fc37631fe765d8ae2eefe419f6..9043fdd6bf6fd38d5a66d04fe978c596e57dfd11 100644 (file)
@@ -291,12 +291,19 @@ vc_exop(
                        "%s VERIFYCREDENTIALS", op->o_log_prefix );
        }
 
+       conn->op->o_tag = LDAP_REQ_BIND;
+       memset( &conn->op->oq_bind, 0, sizeof( conn->op->oq_bind ) );
+       conn->op->o_req_dn = ndn;
+       conn->op->o_req_ndn = ndn;
+       conn->op->o_protocol = LDAP_VERSION3;
+       conn->op->orb_method = authtag;
+       conn->op->o_callback = &sc;
+
        /* TODO: controls */
        tag = ber_peek_tag( ber, &len );
        if ( tag == LDAP_TAG_EXOP_VERIFY_CREDENTIALS_CONTROLS ) {
                conn->op->o_ber = ber;
-               rc = get_ctrls( conn->op, &rs2, 0 );
-               (void)ber_free( conn->op->o_ber, 1 );
+               rc = get_ctrls2( conn->op, &rs2, 0, LDAP_TAG_EXOP_VERIFY_CREDENTIALS_CONTROLS );
                if ( rc != LDAP_SUCCESS ) {
                        rs->sr_err = LDAP_PROTOCOL_ERROR;
                        goto done;
@@ -309,14 +316,6 @@ vc_exop(
                goto done;
        }
 
-       conn->op->o_tag = LDAP_REQ_BIND;
-       memset( &conn->op->oq_bind, 0, sizeof( conn->op->oq_bind ) );
-       conn->op->o_req_dn = ndn;
-       conn->op->o_req_ndn = ndn;
-       conn->op->o_protocol = LDAP_VERSION3;
-       conn->op->orb_method = authtag;
-       conn->op->o_callback = &sc;
-
        switch ( authtag ) {
        case LDAP_AUTH_SIMPLE:
                sc.sc_response = slap_null_cb;