}
}
+ for (a=0; a < msg->num_elements; a++) {
+ const char *name = msg->elements[a].name;
+ if (name && name[0] == '@') {
+ ldb_msg_remove_attr(msg, name);
+ }
+ }
+
for (a=0;attrs_from_user && attrs_from_user[a];a++) {
if (check_keep_control_for_attribute(controls_flags, attrs_from_user[a])) {
continue;
struct operational_context *ac;
struct ldb_request *down_req;
const char **search_attrs = NULL;
- unsigned int i, a;
+ unsigned int i, a, b;
int ret;
/* There are no operational attributes on special DNs */
/* in the list of attributes we are looking for, rename any
attributes to the alias for any hidden attributes that can
be fetched directly using non-hidden names */
- for (a=0;ac->attrs && ac->attrs[a];a++) {
+ b = 0;
+ for (a=0; ac->attrs && ac->attrs[a]; a++) {
+ if (ac->attrs[a][0] == '@') {
+ if (a==0) {
+ search_attrs = ldb_attr_list_copy(req, ac->attrs + 1);
+ continue;
+ } else if (!ac->attrs[a+1]) {
+ if (search_attrs == NULL) {
+ search_attrs = ldb_attr_list_copy(req, ac->attrs);
+ }
+ search_attrs[b] = NULL;
+ } else {
+ unsigned c;
+ if (!search_attrs){
+ search_attrs = ldb_attr_list_copy(req, ac->attrs);
+ }
+ for (c=b; search_attrs[c]; c++) {
+ search_attrs[c] = search_attrs[c+1];
+ }
+ b++;
+ }
+ }
+ b++;
if (check_keep_control_for_attribute(ac->controls_flags, ac->attrs[a])) {
continue;
}