Minor tags behaviour change

Arran Cudbard-Bell a.cudbardb at freeradius.org
Fri May 23 20:25:12 CEST 2014


Hi All,

Just a heads up for anyone tags. From 3.0.4 onwards in unlang <attr>:0 will be taken to mean operate only on attributes with no tag value set.

If no tag specifier is used i.e. <attr> or &<attr> it's taken to mean operate on all instances of <attr> regardless of tag value.

Previous behaviour was inconsistent and in some cases <attr>:0 was treated the same as <attr>.

I highly doubt anyone was using <attr>:0 to select untagged attributes previously, so this shouldn't be a disruptive change.

If you weren't aware, we now also support deleting attributes by index and/or tag.

update request {
	Tunnel-Server-Endpoint:1[1] !* ANY
}

Will remove the second Tunnel-Server-Endpoint attributes with a tag of 1.

update request {
	Tunnel-Server-Endpoint:1 -= 'foo'
}

Will remove any Tunnel-Server-Endpoint attributes with a tag of 1 which have a value of 'foo'.

With 3.0.4 radius_map2request was changed to allow it to operate on multiple values. You won't see any change in normal unlang behaviour, but it does allow some extra special magic when using LDAP.

For example if you have multiple instances of the same ldap attribute:

naughtyWords: foo
naughtyWords: bar
naughtyWords: baz

and you did

ldap {
	update {
		reply:Reply-Message -= 'naughtyWords'
	}
}

It would remove any Reply-Message which had a value matching any one of the LDAP naughtyWords, just as:

ldap {
	update {
		reply:Chargeable-User-Identity += 'naughtyWords'
	}
}

Would add multiple Chargeable-User-Identity attributes.

There's some slight weirdness with this, if you do:

ldap {
	update {
		reply:Reply-Message := 'naughtyWords'
	}
}

Reply-Message will actually be set to baz.

-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: 881 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20140523/4fe41675/attachment.pgp>


More information about the Freeradius-Users mailing list