segfault with regex and hint

Alan DeKok aland at deployingradius.com
Wed Aug 19 09:02:57 CEST 2009


Alexander Clouter wrote:
> I am running FreeRADIUS from git[1] about two days ago and found that by 
> putting the following in my 'hints' file gives me the segfault shown 
> below[2].  If I remove the end bit[3] then I do not get the segfault, 
> but then I also do not get my comparison :)
> 
> Any more information needed, then let me know.

  I've committed a fix.

> Cheers
> 
> [1] at commit 08baab6769fea367bda5dd006b659621bb9aac18 from 
> 	yesterday-ish
> [2] strlcpy sourced from address 0x0
> [3] User-Name =~ "/^%{1}%{2}%{3}%{4}%{5}%{6}$/i"
> 
> ----
> DEFAULT NAS-Port-Type == "Ethernet", User-Name == "%{User-Password}", Calling-Station-Id =~ "/^([0-9a-f]{2}).?([0-9a-f]{2}).?([0-9a-f]{2}).?([0-9a-f]{2}).?([0-9a-f]{2}).?([0-9a-f]{2})$/i", User-Name =~ "/^%{1}%{2}%{3}%{4}%{5}%{6}$/i"

  Well... that really won't work.  The regular expressions in the
"users" file are just the strings:

	Foo =~ "a*b"

  NOT
	Foo =~ "/a*b/i"

  If you want policies that are slightly complicated, use "unlang".
Really.  Delete these entries from the "hints" file, and replace them
with unlang-style policies.

  Alan DeKok.



More information about the Freeradius-Users mailing list