Skip to content

Commit

Permalink
fix auto-creation of Vendor-Specific
Browse files Browse the repository at this point in the history
it was created and added by number, but not by name.  That's wrong.

And arguably we should only do this for the RADIUS dictionary...
  • Loading branch information
alandekok committed Dec 19, 2018
1 parent 33f02b4 commit 95b21a6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/lib/util/dict.c
Expand Up @@ -4967,11 +4967,19 @@ static int _dict_from_file(dict_from_file_ctx_t *ctx,
if (!vsa_da) {
memset(&flags, 0, sizeof(flags));

memcpy(&mutable, &ctx->parent, sizeof(mutable));
new = dict_attr_alloc(mutable, fr_dict_root(ctx->dict), "Vendor-Specific",
FR_VENDOR_SPECIFIC, FR_TYPE_VSA, &flags);
dict_attr_child_add(mutable, new);
vsa_da = new;
if (fr_dict_attr_add(ctx->dict, ctx->parent, "Vendor-Specific",
FR_VENDOR_SPECIFIC, FR_TYPE_VSA, &flags) < 0) {
fr_strerror_printf_push("Failed adding Vendor-Specific for Vendor %s",
vendor->name);
goto error;
}

vsa_da = fr_dict_attr_child_by_num(ctx->parent, FR_VENDOR_SPECIFIC);
if (!vsa_da) {
fr_strerror_printf_push("Failed finding Vendor-Specific for Vendor %s",
vendor->name);
goto error;
}
}
}

Expand Down

0 comments on commit 95b21a6

Please sign in to comment.