From f834cdb2f74e0f221a157aeba5f9b1185908354c Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 9 Sep 2007 21:48:17 +0000 Subject: [PATCH] fix proxyAuthz oid setup --- servers/slapd/back-ldap/bind.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index e5878a2cbd..02485e8c1a 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -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:; -- 2.39.5