cleanup identity assertion; ready for porting to back-meta

This commit is contained in:
Pierangelo Masarati 2006-06-10 16:33:26 +00:00
parent 6bd9aa3755
commit 31a004840d
9 changed files with 19 additions and 19 deletions

View file

@ -93,7 +93,7 @@ ldap_back_add(
attrs[ i ] = NULL;
ctrls = op->o_ctrls;
rs->sr_err = ldap_back_proxy_authz_ctrl( lc, op, rs, &ctrls );
rs->sr_err = ldap_back_proxy_authz_ctrl( &lc->lc_bound_ndn, op, rs, &ctrls );
if ( rs->sr_err != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
goto cleanup;

View file

@ -33,7 +33,7 @@
#include "slap.h"
#include "back-ldap.h"
#include <lutil_ldap.h>
#include "lutil_ldap.h"
#ifndef PRINT_CONNTREE
#define PRINT_CONNTREE 0
@ -1478,6 +1478,11 @@ ldap_back_proxy_authz_bind( ldapconn_t *lc, Operation *op, SlapReply *rs, ldap_b
/* fall thru */
default:
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
if ( sendok & LDAP_BACK_SENDERR ) {
send_ldap_result( op, rs );
}
LDAP_BACK_CONN_ISBOUND_CLEAR( lc );
goto done;
}
@ -1737,7 +1742,7 @@ done:;
*/
int
ldap_back_proxy_authz_ctrl(
ldapconn_t *lc,
struct berval *bound_ndn,
Operation *op,
SlapReply *rs,
LDAPControl ***pctrls )
@ -1810,7 +1815,7 @@ ldap_back_proxy_authz_ctrl(
goto done;
}
if ( !BER_BVISNULL( &lc->lc_bound_ndn ) ) {
if ( !BER_BVISNULL( bound_ndn ) ) {
goto done;
}
@ -1823,14 +1828,9 @@ ldap_back_proxy_authz_ctrl(
}
} else if ( li->li_idassert_authmethod == LDAP_AUTH_SASL ) {
if ( ( li->li_idassert_flags & LDAP_BACK_AUTH_NATIVE_AUTHZ )
/* && ( !BER_BVISNULL( &ndn )
|| LDAP_BACK_CONN_ISBOUND( lc ) ) */ )
if ( ( li->li_idassert_flags & LDAP_BACK_AUTH_NATIVE_AUTHZ ) )
{
/* already asserted in SASL via native authz */
/* NOTE: the test on lc->lc_bound is used to trap
* native authorization of anonymous users,
* since in that case ndn is NULL */
goto done;
}
@ -1927,7 +1927,7 @@ ldap_back_proxy_authz_ctrl(
}
/* don't idassert the bound DN (ITS#4497) */
if ( dn_match( &assertedID, &lc->lc_bound_ndn ) ) {
if ( dn_match( &assertedID, bound_ndn ) ) {
goto done;
}

View file

@ -49,7 +49,7 @@ ldap_back_compare(
}
ctrls = op->o_ctrls;
rc = ldap_back_proxy_authz_ctrl( lc, op, rs, &ctrls );
rc = ldap_back_proxy_authz_ctrl( &lc->lc_bound_ndn, op, rs, &ctrls );
if ( rc != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
goto cleanup;

View file

@ -51,7 +51,7 @@ ldap_back_delete(
}
ctrls = op->o_ctrls;
rc = ldap_back_proxy_authz_ctrl( lc, op, rs, &ctrls );
rc = ldap_back_proxy_authz_ctrl( &lc->lc_bound_ndn, op, rs, &ctrls );
if ( rc != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
rc = rs->sr_err;

View file

@ -56,7 +56,7 @@ ldap_back_extended_one( Operation *op, SlapReply *rs, BI_op_extended exop )
}
oldctrls = op->o_ctrls;
if ( ldap_back_proxy_authz_ctrl( lc, op, rs, &op->o_ctrls ) ) {
if ( ldap_back_proxy_authz_ctrl( &lc->lc_bound_ndn, op, rs, &op->o_ctrls ) ) {
op->o_ctrls = oldctrls;
send_ldap_extended( op, rs );
rs->sr_text = NULL;

View file

@ -99,7 +99,7 @@ ldap_back_modify(
modv[ i ] = 0;
ctrls = op->o_ctrls;
rc = ldap_back_proxy_authz_ctrl( lc, op, rs, &ctrls );
rc = ldap_back_proxy_authz_ctrl( &lc->lc_bound_ndn, op, rs, &ctrls );
if ( rc != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
rc = -1;

View file

@ -74,7 +74,7 @@ ldap_back_modrdn(
}
ctrls = op->o_ctrls;
rc = ldap_back_proxy_authz_ctrl( lc, op, rs, &ctrls );
rc = ldap_back_proxy_authz_ctrl( &lc->lc_bound_ndn, op, rs, &ctrls );
if ( rc != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
rc = -1;

View file

@ -67,7 +67,7 @@ extern void ldap_back_conn_free( void *c );
extern int
ldap_back_proxy_authz_ctrl(
ldapconn_t *lc,
struct berval *bound_ndn,
Operation *op,
SlapReply *rs,
LDAPControl ***pctrls );

View file

@ -203,7 +203,7 @@ ldap_back_search(
}
ctrls = op->o_ctrls;
rc = ldap_back_proxy_authz_ctrl( lc, op, rs, &ctrls );
rc = ldap_back_proxy_authz_ctrl( &lc->lc_bound_ndn, op, rs, &ctrls );
if ( rc != LDAP_SUCCESS ) {
goto finish;
}
@ -762,7 +762,7 @@ ldap_back_entry_get(
}
ctrls = op->o_ctrls;
rc = ldap_back_proxy_authz_ctrl( lc, op, &rs, &ctrls );
rc = ldap_back_proxy_authz_ctrl( &lc->lc_bound_ndn, op, &rs, &ctrls );
if ( rc != LDAP_SUCCESS ) {
goto cleanup;
}