[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#4302) slapi_send_ldap_result() can not send LDAPControls

Full_Name: Darin Broady
Version: 2.3.12,2.3.14 & HEAD
OS: Solaris 9
Submission from: (NULL) (

I am writing a prebind plugin that will send back it's own results, and at
certain times, it will need to be able to send back an LDAPControl.  As such, I
am doing the following:

   int rc = LDAP_SUCCESS;
   LDAPControl ctrl;  /*Set appropriately*/
   slapi_pblock_set(pb, SLAPI_ADD_CONTROL, (void*)&ctrl);
   slapi_send_ldap_result(pb, rc, NULL, NULL, 0, NULL);

However, my controls are not being sent.  They were being sent in OpenLDAP-2.2. 
I believe that I have tracked this down to the checkin done between 1.157 &
1.158 of servers/slapd/slapi/slapi_utils.c.  1.157 has a  slapi_pblock_get(pb,
SLAPI_RESCONTROLS, &rs.sr_ctrls) in slapi_send_ldap_result(), where in 1.158 it
was removed during the reorganization.

I believe that slapi_send_ldap_result() needs to have the following line added
(or something similar):
     slapi_pblock_get(pb, SLAPI_RESCONTROLS, &rs->sr_ctrls);
so that controls can be sent from SLAPI to the client.