ITS#6518 Only remove proxyauthz control if we generated one ourselves

This commit is contained in:
Ondřej Kuzník 2021-02-01 17:22:35 +00:00
parent 4da575d451
commit 1aecfe0b8f
3 changed files with 6 additions and 3 deletions

View file

@ -1348,7 +1348,8 @@ asyncmeta_controls_add( Operation *op,
LDAP_CONTROL_PROXY_AUTHZ, op->o_ctrls, NULL );
for ( i = 0; op->o_ctrls[ i ]; i++ ) {
if ( proxyauthz && proxyauthz == op->o_ctrls[ i ] ) {
/* Only replace it if we generated one */
if ( j1 && proxyauthz && proxyauthz == op->o_ctrls[ i ] ) {
/* Frontend has already checked only one is present */
assert( skipped == 0 );
skipped++;

View file

@ -2897,7 +2897,8 @@ ldap_back_controls_add(
LDAP_CONTROL_PROXY_AUTHZ, op->o_ctrls, NULL );
for ( i = 0; op->o_ctrls[ i ]; i++ ) {
if ( proxyauthz && proxyauthz == op->o_ctrls[ i ] ) {
/* Only replace it if we generated one */
if ( j1 && proxyauthz && proxyauthz == op->o_ctrls[ i ] ) {
/* Frontend has already checked only one is present */
assert( skipped == 0 );
skipped++;

View file

@ -1723,7 +1723,8 @@ meta_back_controls_add(
LDAP_CONTROL_PROXY_AUTHZ, op->o_ctrls, NULL );
for ( i = 0; op->o_ctrls[ i ]; i++ ) {
if ( proxyauthz && proxyauthz == op->o_ctrls[ i ] ) {
/* Only replace it if we generated one */
if ( j1 && proxyauthz && proxyauthz == op->o_ctrls[ i ] ) {
/* Frontend has already checked only one is present */
assert( skipped == 0 );
skipped++;