Concatenating Attributes with semi-colon (;)
Dean Arnold
dean at 31st.me
Tue Dec 7 18:46:37 CET 2021
Thank you Alan,
Both are great solutions. I was looking through the FreeRadius xlat source
for a concat function. Thank you for the rapid code update!
I'll pull down the Ubuntu FreeRadius Source packages, apply the patch and
re-build on my lab FreeRadius server.
On Tue, Dec 7, 2021 at 7:34 AM Alan DeKok <aland at deployingradius.com> wrote:
> On Dec 7, 2021, at 3:18 AM, Dean Arnold <dean at 31st.me> wrote:
> > I am using FreeRadius with Google Secure LDAP & WPA2 Enterprise Auth and
> > it's working great!
>
> That's good to hear.
>
> > Is there a way to create a semi-colon (;) delimiter list from a multi
> > valued attribute?
>
> Um... no. :(
>
> So I've added it to v3.0.x branch on GitHub:
>
>
> https://github.com/FreeRADIUS/freeradius-server/commit/b8ad37d305b1c55ab22fda0fd1089530be708e1c
>
> That patch *should* apply cleanly to 3.0.20 or later. But whatever you
> do, you'll have to re-build the server with the patch.
>
> > Thank you in advance.
> >
> > This is my default site post-auth:
> >
> > foreach &reply:ldapMemberOf {
> > if ("%{Foreach-Variable-0}" =~ /cn=([^,=]+)/) {
> > update reply { classMemberOf += "%{1}" }
> > }
> > }
> > update reply { Class = "%{reply:classMemberOf[*]}"
>
> You can also do:
>
> foreach &reply:ldapMemberOf {
> if ("%{Foreach-Variable-0}" =~ /cn=([^,=]+)/) {
> update reply { classMemberOf :=
> "%{classMemberOf};%{1}" }
> }
> }
>
> Which should work. But it's a little fugly.
>
> I've added:
>
> %{concat:foo[*] ;}
>
> So you could do:
>
> foreach &reply:ldapMemberOf {
> if ("%{Foreach-Variable-0}" =~ /cn=([^,=]+)/) {
> update reply { classMemberOf += "%{1}" }
> }
> }
> update reply {
> Class += %{concat:reply:classMemberOf[*] ;}"
> }
>
> And that would work.
>
> Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
More information about the Freeradius-Users
mailing list