String expansion of attributes value from database
Arran Cudbard-Bell
a.cudbardb at freeradius.org
Tue Jul 12 13:59:58 CEST 2016
> On 12 Jul 2016, at 05:17, Krzysztof Grobelak <krzysztof.grobelak at enet.ie> wrote:
>
> Hello All,
>
> Is it possible to have similar functionality in a database stored reply item as with users file?
>
> in users file:
>
> user1 Cleartext-Password := “super_secret"
> Alc-Subsc-ID-Str := "%{Alc-Client-Hardware-Addr}",
> Alc-Subsc-Prof-Str := "sub_profile_1",
> Alc-SLA-Prof-Str := “sla_profile_1"
>
> The above works and the %{Alc-Client-Hardware-Addr} gets expanded to a correct mac address.
>
> However when the following is used in database:
>
> +----+----------------+--------------------+----+-------------------------------+
> | id | groupname | attribute | op | value |
> +----+----------------+--------------------+----+-------------------------------+
> | 1 | profile_1 | Alc-Subsc-ID-Str | := | "%{Alc-Client-Hardware-Addr}" |
> | 2 | profile_1 | Alc-Subsc-Prof-Str | := | sub_profile_1 |
> | 3 | profile_1 | Alc-SLA-Prof-Str | := | sla_profile_1 |
> +----+----------------+--------------------+----+-------------------------------+
>
> The value of Alc-Subsc-ID-Str attribute is returned as is, without expansion.
>
> The comments in the sql module say that the sql should mirror the users file in functionality so i’m assuming i’m missing something ;)
>
> Can you advice please?
In v3.1.x you can use %{xlat:<value>}
But yeah, there should be a quoting column or something I guess. Fell free to submit patches against v4.0.x.
-Arran
Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS Development Team
FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 872 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20160712/8aaf4d4d/attachment.sig>
More information about the Freeradius-Users
mailing list