]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use map_to_request in place of map_to_vp to handle nested attributes
authorNick Porter <nick@portercomputing.co.uk>
Fri, 22 Sep 2023 15:13:40 +0000 (16:13 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 22 Sep 2023 15:13:40 +0000 (16:13 +0100)
This allows for nested attributes to be handled in the rlm_ldap module
update map such that

update {
&control += "radiusControlAttribute"
}

with a directory entry containting

radiusControlAttribute: Vendor-Specific.Cisco.AVPair += 'foo=bar'

will result in the correct nested structure being built.

src/lib/ldap/map.c

index 0a544594b83af7a8a67e44ac5627322d4f026f96..3467e49cc6a4d8582734983ffe16435ce6dada18 100644 (file)
@@ -141,13 +141,12 @@ int fr_ldap_map_getvalue(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *reques
                                goto next_pair;
                        }
 
-                       if (map_to_vp(ctx, &tmp_list, request, attr, NULL) < 0) {
+                       if (map_to_request(request, attr, map_to_vp, NULL) < 0) {
                                RWDEBUG("Failed creating attribute for valuepair \"%pV\", skipping...",
                                        fr_box_strvalue_len(self->values[i]->bv_val, self->values[i]->bv_len));
                                goto next_pair;
                        }
 
-                       fr_pair_list_append(&head, &tmp_list);
                        talloc_free(attr);
 
                        /*