const_attrs = req->op.search.attrs;
+ /* We only need to do special processing if we were asked for
+ * the extended DN, or we are 'store DN+GUID+SID'
+ * (!dereference) mode. (This is the normal mode for LDB on
+ * tdb). */
if (control || (storage_format_control && private && !private->dereference)) {
ac->inject = true;
if (extended_ctrl) {
}
}
- if (private && private->dereference && private->dereference_control) {
-
- /* Add in dereference control */
+ /* Add in dereference control, if we were asked to, we are
+ * using the 'dereference' mode (such as with an OpenLDAP
+ * backend) and have the control prepared */
+ if (control && private && private->dereference && private->dereference_control) {
ret = ldb_request_add_control(down_req,
DSDB_OPENLDAP_DEREFERENCE_CONTROL,
false, private->dereference_control);