quick fix for vc: allow custom controls tag

This commit is contained in:
Pierangelo Masarati 2011-01-04 00:09:10 +00:00
parent 180ad95b16
commit 1a56a1934a
2 changed files with 18 additions and 2 deletions

View file

@ -690,10 +690,21 @@ int slap_parse_ctrl(
return rc; return rc;
} }
int get_ctrls( int
get_ctrls(
Operation *op, Operation *op,
SlapReply *rs, SlapReply *rs,
int sendres ) int sendres )
{
return get_ctrls2( op, rs, sendres, LDAP_TAG_CONTROLS );
}
int
get_ctrls2(
Operation *op,
SlapReply *rs,
int sendres,
ber_tag_t ctag )
{ {
int nctrls = 0; int nctrls = 0;
ber_tag_t tag; ber_tag_t tag;
@ -719,7 +730,7 @@ int get_ctrls(
return rs->sr_err; return rs->sr_err;
} }
if(( tag = ber_peek_tag( ber, &len )) != LDAP_TAG_CONTROLS ) { if(( tag = ber_peek_tag( ber, &len )) != ctag ) {
if( tag == LBER_ERROR ) { if( tag == LBER_ERROR ) {
rs->sr_err = SLAPD_DISCONNECT; rs->sr_err = SLAPD_DISCONNECT;
rs->sr_text = "unexpected data in PDU"; rs->sr_text = "unexpected data in PDU";

View file

@ -650,6 +650,11 @@ LDAP_SLAPD_F (int) get_ctrls LDAP_P((
Operation *op, Operation *op,
SlapReply *rs, SlapReply *rs,
int senderrors )); int senderrors ));
LDAP_SLAPD_F (int) get_ctrls2 LDAP_P((
Operation *op,
SlapReply *rs,
int senderrors,
ber_tag_t ctag ));
LDAP_SLAPD_F (int) register_supported_control2 LDAP_P(( LDAP_SLAPD_F (int) register_supported_control2 LDAP_P((
const char *controloid, const char *controloid,
slap_mask_t controlmask, slap_mask_t controlmask,