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;
#include "slap.h"
#include "back-ldap.h"
-#include <lutil_ldap.h>
+#include "lutil_ldap.h"
#ifndef PRINT_CONNTREE
#define PRINT_CONNTREE 0
/* 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;
}
*/
int
ldap_back_proxy_authz_ctrl(
- ldapconn_t *lc,
+ struct berval *bound_ndn,
Operation *op,
SlapReply *rs,
LDAPControl ***pctrls )
goto done;
}
- if ( !BER_BVISNULL( &lc->lc_bound_ndn ) ) {
+ if ( !BER_BVISNULL( bound_ndn ) ) {
goto done;
}
}
} 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;
}
}
/* don't idassert the bound DN (ITS#4497) */
- if ( dn_match( &assertedID, &lc->lc_bound_ndn ) ) {
+ if ( dn_match( &assertedID, bound_ndn ) ) {
goto done;
}
}
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;
}
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;
}
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;
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;
}
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;
extern int
ldap_back_proxy_authz_ctrl(
- ldapconn_t *lc,
+ struct berval *bound_ndn,
Operation *op,
SlapReply *rs,
LDAPControl ***pctrls );
}
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;
}
}
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;
}