fix previous commit

This commit is contained in:
Pierangelo Masarati 2007-09-15 18:03:55 +00:00
parent d92e8ad1f7
commit 43c00ab486
2 changed files with 16 additions and 6 deletions

View File

@ -2540,6 +2540,8 @@ ldap_back_controls_add(
goto done;
}
/* put controls that go __before__ existing ones here */
/* proxyAuthz for identity assertion */
switch ( ldap_back_proxy_authz_ctrl( op, rs, &lc->lc_bound_ndn,
li->li_version, &li->li_idassert, &c[ j1 ] ) )
@ -2555,6 +2557,8 @@ ldap_back_controls_add(
goto done;
}
/* put controls that go __after__ existing ones here */
#ifdef SLAP_CONTROL_X_SESSION_TRACKING
/* FIXME: according to <draft-wahl-ldap-session>,
* the server should check if the control can be added
@ -2580,12 +2584,13 @@ ldap_back_controls_add(
rs->sr_err = LDAP_SUCCESS;
}
assert( j1 + j1 <= sizeof( c )/sizeof(LDAPControl) );
/* if nothing to do, just bail out */
if ( j1 == 0 && j2 == 0 ) {
goto done;
}
assert( j1 + j1 <= sizeof( c )/sizeof(LDAPControl) );
if ( op->o_ctrls ) {
for ( n = 0; op->o_ctrls[ n ]; n++ )
/* just count ctrls */ ;
@ -2609,8 +2614,8 @@ ldap_back_controls_add(
}
}
n += j1;
if ( j2 ) {
n += j1;
ctrls[ n ] = (LDAPControl *)&ctrls[ n + j2 + 1 ] + j1;
*ctrls[ n ] = c[ j1 ];
for ( i = 1; i < j2; i++ ) {

View File

@ -1602,6 +1602,8 @@ meta_back_controls_add(
goto done;
}
/* put controls that go __before__ existing ones here */
/* proxyAuthz for identity assertion */
switch ( ldap_back_proxy_authz_ctrl( op, rs, &msc->msc_bound_ndn,
mt->mt_version, &mt->mt_idassert, &c[ j1 ] ) )
@ -1617,6 +1619,8 @@ meta_back_controls_add(
goto done;
}
/* put controls that go __after__ existing ones here */
#ifdef SLAP_CONTROL_X_SESSION_TRACKING
/* session tracking */
if ( META_BACK_TGT_ST_REQUEST( mt ) ) {
@ -1638,12 +1642,13 @@ meta_back_controls_add(
rs->sr_err = LDAP_SUCCESS;
}
assert( j1 + j1 <= sizeof( c )/sizeof(LDAPControl) );
/* if nothing to do, just bail out */
if ( j1 == 0 && j2 == 0 ) {
goto done;
}
assert( j1 + j1 <= sizeof( c )/sizeof(LDAPControl) );
if ( op->o_ctrls ) {
for ( n = 0; op->o_ctrls[ n ]; n++ )
/* just count ctrls */ ;
@ -1667,8 +1672,8 @@ meta_back_controls_add(
}
}
n += j1;
if ( j2 ) {
n += j1;
ctrls[ n ] = (LDAPControl *)&ctrls[ n + j2 + 1 ] + j1;
*ctrls[ n ] = c[ j1 ];
for ( i = 1; i < j2; i++ ) {