From 1a56a1934a123a0bccdc7ea2c6be36b12e60dcb5 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 4 Jan 2011 00:09:10 +0000 Subject: [PATCH] quick fix for vc: allow custom controls tag --- servers/slapd/controls.c | 15 +++++++++++++-- servers/slapd/proto-slap.h | 5 +++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 18a7927a29..c4f9309d68 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -690,10 +690,21 @@ int slap_parse_ctrl( return rc; } -int get_ctrls( +int +get_ctrls( Operation *op, SlapReply *rs, 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; ber_tag_t tag; @@ -719,7 +730,7 @@ int get_ctrls( 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 ) { rs->sr_err = SLAPD_DISCONNECT; rs->sr_text = "unexpected data in PDU"; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 5eafeb9105..c28f7c054d 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -650,6 +650,11 @@ LDAP_SLAPD_F (int) get_ctrls LDAP_P(( Operation *op, SlapReply *rs, 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(( const char *controloid, slap_mask_t controlmask, -- 2.39.5