- /* if backendInfo == slap_binfo no deallocation of old backendInfo */
- if (backendInfo == slap_binfo) {
- newBackendInfo = ch_calloc(nBackendInfo + 1, sizeof(BackendInfo));
- AC_MEMCPY(newBackendInfo, backendInfo,
- sizeof(BackendInfo) * nBackendInfo);
+static int
+backend_set_controls( BackendDB *be )
+{
+ BackendInfo *bi = be->bd_info;
+
+ /* back-relay takes care of itself; so may do other */
+ if ( overlay_is_over( be ) ) {
+ bi = ((slap_overinfo *)be->bd_info->bi_private)->oi_orig;
+ }
+
+ if ( bi->bi_controls ) {
+ if ( be->be_ctrls[ SLAP_MAX_CIDS ] == 0 ) {
+ AC_MEMCPY( be->be_ctrls, bi->bi_ctrls,
+ sizeof( be->be_ctrls ) );
+ be->be_ctrls[ SLAP_MAX_CIDS ] = 1;
+