Hello, Just taking a look at the FreeRadius 2.2 policy.conf file, and noticed this section: ===================================== # # reject Multiple @'s # e.g. "user@site.com@site.com" # if(User-Name =~ /@(.+)?@/i ) { ===================================== Would this not be simpler just by using '/@.*@/' ? John. -- John Horne Tel: +44 (0)1752 587287 Plymouth University, UK Fax: +44 (0)1752 587001
hi, if(User-Name =~ /@(.+)?@/i ) { ===================================== Would this not be simpler just by using '/@.*@/' ? its good to get feedback. yes, theres no need for case insensitive for this one....and also, we dont care about feeding the results to a following process....so no need for the brackets. alan
hi, ..theres also an error in v2.2 policy.conf # # Realm begins with a dot # e.g. "user@.site.com" # if (User-Name !~ /@\\./) { update reply { Reply-Message+ = "Rejected: Realm begins with a dot" } reject } MUST, in fact, be: # # Realm begins with a dot # e.g. "user@.site.com" # if (User-Name =~ /@\\./) { update reply { Reply-Message += "Rejected: Realm begins with a dot" } reject } alan
On Wed, Nov 28, 2012 at 01:09:44PM +0000, John Horne wrote:
# if(User-Name =~ /@(.+)?@/i ) { =====================================
Would this not be simpler just by using '/@.*@/' ?
That's not quite the same, as it would match more than the original regex. OK the parenthesis aren't needed, however consider the following username: bob@@realm The original regex will not match this however the simpler one will. '/@.+@/' would be more compatible. Ben -- Ben Brown Systems Engineer Plusnet PLC | www.plus.net Registered Office: Plusnet | The Balance | 2 Pinfold Street | Sheffield | S1 2GU Registered in England no: 3279013 This email and any attachments contains Plusnet information, which may be privileged or confidential. It's meant only for the individual(s) or entity named above. If you're not the intended recipient, note that disclosing, copying, distributing or using this information is prohibited. If you've received this email in error, please let me know immediately on the email address above. Thank you. We monitor our email system, and may record your emails.
On 28 Nov 2012, at 15:08, alan buxey <A.L.M.Buxey@LBORO.AC.UK> wrote:
Hi,
That's not quite the same, as it would match more than the original regex. OK the parenthesis aren't needed, however consider the following username:
bob@@realm
that would be a wrong and illegal entry...so needs to be rejected too.
When ya'll decided what you want the regexps to be, send a pull request? :) -Arran
On 28 Nov 2012, at 15:08, alan buxey <A.L.M.Buxey@LBORO.AC.UK> wrote:
Hi,
That's not quite the same, as it would match more than the original regex. OK the parenthesis aren't needed, however consider the following username:
bob@@realm
that would be a wrong and illegal entry...so needs to be rejected too.
When ya'll decided what you want the regexps to be, send a pull request? :)
Looking at the master branch in git, this file has been replaced by a directory with several files (proxy.d). The example of filter_username in proxy.d/filter uses /@.*@/ which as we've discovered on the list is fine for the purpose of this filter. No pull necessary ;) Ben -- Ben Brown Systems Engineer Plusnet PLC | www.plus.net Registered Office: Plusnet | The Balance | 2 Pinfold Street | Sheffield | S1 2GU Registered in England no: 3279013 This email and any attachments contains Plusnet information, which may be privileged or confidential. It's meant only for the individual(s) or entity named above. If you're not the intended recipient, note that disclosing, copying, distributing or using this information is prohibited. If you've received this email in error, please let me know immediately on the email address above. Thank you. We monitor our email system, and may record your emails.
On Thu, Nov 29, 2012 at 09:16:48AM +0000, Ben Brown wrote:
Looking at the master branch in git, this file has been replaced by a directory with several files (proxy.d). The example of filter_username in proxy.d/filter uses /@.*@/ which as we've discovered on the list is fine for the purpose of this filter. No pull necessary ;)
yes, that was pushed last night. the 2.2.x has also been changed alan
participants (6)
-
A.L.M.Buxey@lboro.ac.uk -
Alan Buxey -
alan buxey -
Arran Cudbard-Bell -
Ben Brown -
John Horne