]> git.sur5r.net Git - openldap/commitdiff
fix proxyAuthz oid setup
authorPierangelo Masarati <ando@openldap.org>
Sun, 9 Sep 2007 21:48:17 +0000 (21:48 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 9 Sep 2007 21:48:17 +0000 (21:48 +0000)
servers/slapd/back-ldap/bind.c

index e5878a2cbd965e22919dc4042d9be6f46356faa6..02485e8c1a6df05f3cf96284eaef41200fd23ee6 100644 (file)
@@ -2393,11 +2393,14 @@ ldap_back_proxy_authz_ctrl(
                goto done;
        }
 
+       ctrl->ldctl_oid = LDAP_CONTROL_PROXY_AUTHZ;
+
        switch ( si->si_mode ) {
        /* already in u:ID or dn:DN form */
        case LDAP_BACK_IDASSERT_OTHERID:
        case LDAP_BACK_IDASSERT_OTHERDN:
                ber_dupbv_x( &ctrl->ldctl_value, &assertedID, op->o_tmpmemctx );
+               rs->sr_err = LDAP_SUCCESS;
                break;
 
        /* needs the dn: prefix */
@@ -2408,6 +2411,7 @@ ldap_back_proxy_authz_ctrl(
                AC_MEMCPY( ctrl->ldctl_value.bv_val, "dn:", STRLENOF( "dn:" ) );
                AC_MEMCPY( &ctrl->ldctl_value.bv_val[ STRLENOF( "dn:" ) ],
                                assertedID.bv_val, assertedID.bv_len + 1 );
+               rs->sr_err = LDAP_SUCCESS;
                break;
        }
 
@@ -2435,6 +2439,8 @@ ldap_back_proxy_authz_ctrl(
                        goto free_ber;
                }
 
+               rs->sr_err = LDAP_SUCCESS;
+
 free_ber:;
                op->o_tmpfree( authzID.bv_val, op->o_tmpmemctx );
                ber_free_buf( ber );
@@ -2475,6 +2481,9 @@ free_ber:;
                        goto free_ber2;
                }
 
+               ctrl->ldctl_oid = LDAP_CONTROL_OBSOLETE_PROXY_AUTHZ;
+               rs->sr_err = LDAP_SUCCESS;
+
 free_ber2:;
                op->o_tmpfree( authzID.bv_val, op->o_tmpmemctx );
                ber_free_buf( ber );
@@ -2482,8 +2491,6 @@ free_ber2:;
                if ( rs->sr_err != LDAP_SUCCESS ) {
                        goto done;
                }
-
-               ctrl->ldctl_oid = LDAP_CONTROL_OBSOLETE_PROXY_AUTHZ;
        }
 
 done:;