unlang - delete attribute - !*

2013-10-09 Thread Hachmer, Tobias
Hello list, I want to delete one reply attribute from the reply list if the access-request is originating not from a special NAS-IP-Address. Currently I have solved this by adding this unlang code in authorize section: if(!NAS-IP-Address == x.x.x.x) { update reply

Re: unlang - delete attribute - !*

2013-10-09 Thread Arran Cudbard-Bell
On 9 Oct 2013, at 07:05, Hachmer, Tobias tobias.hach...@stadt-frankfurt.de wrote: Hello list, I want to delete one reply attribute from the reply list if the access-request is originating not from a special NAS-IP-Address. Currently I have solved this by adding this unlang code

AW: unlang - delete attribute - !*

2013-10-09 Thread Hachmer, Tobias
Auftrag von Arran Cudbard-Bell Gesendet: Mittwoch, 9. Oktober 2013 08:22 An: FreeRadius users mailing list Betreff: Re: unlang - delete attribute - !* On 9 Oct 2013, at 07:05, Hachmer, Tobias tobias.hach...@stadt-frankfurt.de wrote: Hello list, I want to delete one reply attribute from

Re: Auth by NAS-Identifier using unlang

2013-08-06 Thread Alan Buxey
I assume that's the freeradius2 package rather than freeradius as 1.x doesn't have unlang alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: Auth by NAS-Identifier using unlang

2013-08-06 Thread John Dennis
On 08/06/2013 02:31 AM, Alan Buxey wrote: I assume that's the freeradius2 package rather than freeradius as 1.x doesn't have unlang The OP said Fedora. Fedora has never had a freeradius2 package (only ever existed in RHEL 5.x). Fedora has had 2.x for many years. So either the OP is using

Auth by NAS-Identifier using unlang

2013-08-05 Thread Joseph Perrin
I was thinking this should be easy, but it's been two weeks and I give up... This is what I want to do: My NAS, (a WiFi AP), has two SSIDs: staff and guests. I want mutual exclusivity. My /etc/raddb/users file contains something like this: abc Cleartext-Password:=xyz

Re: Auth by NAS-Identifier using unlang

2013-08-05 Thread Arran Cudbard-Bell
Running radiusd -X I get: : ++? if (Local-Group != NAS-Identifier ) (Attribute Local-Group was not found) ? Evaluating (Local-Group != NAS-Identifier ) - FALSE ++? if (Local-Group != NAS-Identifier ) - FALSE : And it's clear Local-Group is always empty. :-( Yeah you've

Re: Auth by NAS-Identifier using unlang

2013-08-05 Thread A . L . M . Buxey
Hi, I was thinking this should be easy, but it's been two weeks and I give up... well, depends how you do itif you do it easy it is easy, no? users file abc Cleartext-Password := xyz, NAS-Identifier = staff Reply-Message Welcome on-board staff member dont forget, if this

Re: Auth by NAS-Identifier using unlang

2013-08-05 Thread Joseph Perrin
Changing the Local-Group into the request still makes control:Local-Group empty. abc Cleartext-Password:=xyz, Local-Group:=staff NAS Sends this: User-Name = abc : NAS-Identifier = resident if ( control:Local-Group != NAS-Identifier ) { Diagnostic says: ++? if

Re: Auth by NAS-Identifier using unlang

2013-08-05 Thread Arran Cudbard-Bell
Diagnostic says: ++? if (control:Local-Group != NAS-Identifier ) - FALSE Assuming you're not looking for a literal value 'NAS-Identifier', you want %{NAS-Identifier}. If this is a new deployment you should use current HEAD revision in Master. Then you can use the debug_attr expansion to

Re: Auth by NAS-Identifier using unlang

2013-08-05 Thread Joseph Perrin
The following appears to now work, but I don't understand some things: files if (control:Local-Group != %{NAS-Identifier} ) { Why does control:Local-Group not need to be enclosed in %{ }, but NAS-Identifier does? And why does %{ } content need to be within quotes, when the documentation doesn't

Re: Auth by NAS-Identifier using unlang

2013-08-05 Thread Arran Cudbard-Bell
need to be within quotes It's a string expansion, string expansions only function inside double quotes. This is similar to variable expansion in most scripting languages. , when the documentation doesn't say anything about them needing to be in quotes? Man unlang VARIABLES Run-time

Re: Auth by NAS-Identifier using unlang

2013-08-05 Thread Joseph Perrin
Thank you. I now understand. A stock install of freeRadius in Fedora, (i.e. via yum), does not provide a man page for unlang. Had you not helped me, I'd simply not know. On Mon, Aug 5, 2013 at 6:00 PM, Arran Cudbard-Bell a.cudba...@freeradius.org wrote: On 5 Aug 2013, at 22:37, Joseph

Re: Auth by NAS-Identifier using unlang

2013-08-05 Thread John Dennis
On 08/05/2013 08:49 PM, Joseph Perrin wrote: Thank you. I now understand. A stock install of freeRadius in Fedora, (i.e. via yum), does not provide a man page for unlang. Had you not helped me, I'd simply not know. Nonsense, the freeradius rpm installs the unlang man page. Please provide

Re: Substring using Unlang?

2013-07-12 Thread Peter Lambrechtsen
On Wed, Jul 10, 2013 at 6:34 PM, Olivier Beytrison oliv...@heliosnet.org wrote: On 10.07.2013 07:48, Olivier Beytrison wrote: if ( ADSL-Agent-Remote-Id =~ /(.{0,31})$/ ) { if ( ADSL-Agent-Remote-Id =~ /(.{1,32})$/ ) { that's even better as it won't match an empty attribute (you never know

Re: Substring using Unlang?

2013-07-12 Thread Arran Cudbard-Bell
On 13 Jul 2013, at 00:14, Peter Lambrechtsen pe...@crypt.co.nz wrote: On Wed, Jul 10, 2013 at 6:34 PM, Olivier Beytrison oliv...@heliosnet.org wrote: On 10.07.2013 07:48, Olivier Beytrison wrote: if ( ADSL-Agent-Remote-Id =~ /(.{0,31})$/ ) { if ( ADSL-Agent-Remote-Id =~ /(.{1,32})$/ ) {

Re: Substring using Unlang?

2013-07-12 Thread Peter Lambrechtsen
for us :) IMHO those sorts of use cases really should be logged in the unlang wiki or have a generic regex examples wiki page as those sorts of problems come up all the time and it would be nice to direct people to one place that has a lot of good re-usable examples. Might go create a page when I have

Re: Substring using Unlang?

2013-07-10 Thread Olivier Beytrison
On 10.07.2013 07:48, Olivier Beytrison wrote: if ( ADSL-Agent-Remote-Id =~ /(.{0,31})$/ ) { if ( ADSL-Agent-Remote-Id =~ /(.{1,32})$/ ) { that's even better as it won't match an empty attribute (you never know ...) -- Olivier Beytrison Network Security Engineer, HES-SO Fribourg Mail:

Substring using Unlang?

2013-07-09 Thread Peter Lambrechtsen
than 31 chars take the right most 31 chars and only return that. It's pretty simple in perl. And I suspect that is the only way to do it. This can't be done in Unlang or similar interpreted language within freeradius itself? Cheers Peter - List info/subscribe/unsubscribe? See http

Re: Substring using Unlang?

2013-07-09 Thread Olivier Beytrison
On 10.07.2013 05:20, Peter Lambrechtsen wrote: In pseudo code it would be something like: if (length(ADSL-Agent-Remote-Id) 31) { update reply { strncat(SubscriberID, ADSL-Agent-Remote-Id + (strlen(ADSL-Agent-Remote-Id) - 31), 31) } } else { update reply { SubscriberID :=

Re: evaluating unlang IF with sql results

2013-06-14 Thread Bill Schoolfield
Actually this particular issue was the parenthesis around the number. I had added them in the expression to make sure the math occurred before the logical comparison. Without them though, unlang's IF seems to evaluate the first expression (a subtraction) and ignores things afterwards. So the

Re: evaluating unlang IF with sql results

2013-06-14 Thread Alan DeKok
Bill Schoolfield wrote: Actually this particular issue was the parenthesis around the number. I had added them in the expression to make sure the math occurred before the logical comparison. The man unlang documentation describes the syntax it expects. Adding a random paranthesis won't work

unlang and update section

2013-06-13 Thread Bill Schoolfield
Can update sections contain if conditions? I get the following error: /etc/raddb/sites-enabled/default[573]: update sections cannot have subsections /etc/raddb/sites-enabled/default[465]: Errors parsing post-auth section. The documentation says The only contents permitted in an update section

Re: unlang and update section

2013-06-13 Thread Phil Mayers
On 13/06/13 16:07, Bill Schoolfield wrote: Can update sections contain if conditions? I get the following error: No. /etc/raddb/sites-enabled/default[573]: update sections cannot have subsections /etc/raddb/sites-enabled/default[465]: Errors parsing post-auth section. The documentation

Re: unlang and update section

2013-06-13 Thread Phil Mayers
On 13/06/13 16:26, Phil Mayers wrote: The documentation is authoritative. It should need to be confirmed. Shouldn't. Sigh. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: unlang and update section

2013-06-13 Thread Alan DeKok
Bill Schoolfield wrote: Can update sections contain if conditions? I get the following error: /etc/raddb/sites-enabled/default[573]: update sections cannot have subsections What is unclear about that? /etc/raddb/sites-enabled/default[465]: Errors parsing post-auth section. The

Re: unlang and update section

2013-06-13 Thread Russell Mike
Yes, i have come across this error once. there is little mistake in your unlang code. understand form following working code. ## Authorization Area Starts Here # If user not present allow them free access # Between 10:00 and 12:59PM ('Any1000-1259') # Whole Day ('Any-2359

Re: unlang and update section

2013-06-13 Thread Bill Schoolfield
On 6/13/2013 10:33 AM, Alan DeKok wrote: Bill Schoolfield wrote: Can update sections contain if conditions? I get the following error: /etc/raddb/sites-enabled/default[573]: update sections cannot have subsections What is unclear about that? /etc/raddb/sites-enabled/default[465]:

Re: unlang and update section

2013-06-13 Thread Alan DeKok
Bill Schoolfield wrote: From my perspective, yes it was useful to me. I didn't know those were line numbers. Now I know. It seems clear in retrospect but I've seen quite a bit of misleading, outdated or wrong documentation (mostly elsewhere but sometimes at freeradius.org) so I thought I'd

evaluating unlang IF with sql results

2013-06-13 Thread Bill Schoolfield
I can't seem to make this work. I'm comparing some values in the post-auth section: if((%{expr: %{check:Max-All-Session}-%{sql:select sum(acctsessiontime) from radacct where username='%{User-Name}'}}) (%{expr: %{sql:select unix_timestamp(str_to_date('%{check:Expiration}', '%%b %%d

Re: evaluating unlang IF with sql results

2013-06-13 Thread Alan DeKok
Bill Schoolfield wrote: The above code fails with a message (below) that says (Right field is not a number at: (1371158700)). I tried adding a zero to force a number interpretation but this does nothing. That error is produced by the SQL database, not by FreeRADIUS. My guess is that the

reference to check items using unlang

2013-05-20 Thread Nasser Heidari
Hi All, How can I reference to check items using unlang? When I use perl script , simply reference it by $RAD_CHECK. For example I want to check if there is a check item in sql user profile , then do some actions using unlang and if not then ignore it. By the way I know that I can do

Re: reference to check items using unlang

2013-05-20 Thread Arran Cudbard-Bell
On 20 May 2013, at 03:03, Nasser Heidari nas...@rasana.net wrote: Hi All, How can I reference to check items using unlang? When I use perl script , simply reference it by $RAD_CHECK. For example I want to check if there is a check item in sql user profile , then do some actions using

RE: reference to check items using unlang

2013-05-20 Thread Nasser Heidari
I've already tried and it doesn't work. for example I want to check for existence of a custom check-item in user profiles with unlang, I try this: If(control:custom_check_item) { ... } This always returns true in my case , doesn't matter if a user have custom_check_item in his profile

Re: reference to check items using unlang

2013-05-20 Thread Alan DeKok
Nasser Heidari wrote: I've already tried and it doesn't work. That's a fairly useless response. for example I want to check for existence of a custom check-item in user profiles with unlang, I try this: If(control:custom_check_item) { ... } This always returns true in my case

Unlang clarification

2013-05-20 Thread David Peterson
I am fighting a buggy NAS and was told to add to the /sites-enabled/default file in the post-auth section this code: EAP-Message = 0x04040004 User-Name !* 0x00 Message-Authenticator = %{Message-Authenticator} Can

Re: Unlang clarification

2013-05-20 Thread Arran Cudbard-Bell
On 20 May 2013, at 09:34, David Peterson dav...@wirelessconnections.net wrote: I am fighting a buggy NAS and was told to add to the /sites-enabled/default file in the post-auth section this code: EAP-Message = 0x04040004 User-Name !* 0x00

RE: Unlang clarification

2013-05-20 Thread David Peterson
- From: freeradius-users-bounces+davidp=wirelessconnections@lists.freeradius.org [mailto:freeradius-users-bounces+davidp=wirelessconnections.net@lists.freera dius.org] On Behalf Of Arran Cudbard-Bell Sent: Monday, May 20, 2013 9:59 AM To: FreeRadius users mailing list Subject: Re: Unlang

RE: Unlang clarification

2013-05-20 Thread stefan.paetow
...@lists.freeradius.org] On Behalf Of David Peterson Sent: 20 May 2013 15:30 To: FreeRadius users mailing list Subject: RE: Unlang clarification Hmmm...strange. Actually that code was in the post-auth reject sections and this is in the post-auth section: update reply { User-Name !* 0x00

Re: Unlang clarification

2013-05-20 Thread Nick Lowe
Message- From: freeradius-users-bounces+stefan.paetow=diamond.ac...@lists.freeradius.org [mailto:freeradius-users-bounces+stefan.paetow=diamond.ac...@lists.freeradius.org] On Behalf Of David Peterson Sent: 20 May 2013 15:30 To: FreeRadius users mailing list Subject: RE: Unlang

Re: Unlang clarification

2013-05-20 Thread Nick Lowe
*You can of course mandate something like the outer identity must equal the inner identity, or require anonymous@..., which would make the identity spoofing issue one of anonymisation alone. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

using unlang to call a stored procedure

2013-05-20 Thread Alex Sharaz
to format the unlang statement. Elsewhere in my sites-enable/default file I've got if ( %{sql:SELECT count(*) from banned_macs where mac_address=UPPER(TRIM('%{Calling-Station-Id}'))} 0 ) { update control { Auth-Type := Reject } update reply

Re: using unlang to call a stored procedure

2013-05-20 Thread Phil Mayers
On 20/05/13 16:55, Alex Sharaz wrote: In this case I've got Tmp-String-0 := %{sql:call get_vlan_id('%{NAS-IP-Address}','%{User-Name}')} get_vlan_id accepts two varchar arguments. Which, when I run radiusd -X -d /etc/freeradius gives me /etc/freeradius/sites-enabled/default[248]:

Re: using unlang to call a stored procedure

2013-05-20 Thread Alex Sharaz
On 20 May 2013, at 17:16, Phil Mayers wrote: On 20/05/13 16:55, Alex Sharaz wrote: In this case I've got Tmp-String-0 := %{sql:call get_vlan_id('%{NAS-IP-Address}','%{User-Name}')} get_vlan_id accepts two varchar arguments. Which, when I run radiusd -X -d /etc/freeradius

Re: using unlang to call a stored procedure

2013-05-20 Thread Alex Sharaz
Many thanks Phil, all sorted. Wrapping the sql: statement with an update control fixed the Unknown Action error. Haven't checked that I'm returning the correct stuff yet, but I'm past this particular problem Rgds Alex On 20 May 2013, at 17:16, Phil Mayers wrote: On 20/05/13 16:55, Alex

unlang equivalent of radlog

2013-05-19 Thread Nasser Heidari
Hi, I have several Perl modules running on my Radius server, I'm going to remove them all and use unlang instead. I have two questions: 1- The reason that I'm going to change Perl modules with unlang is Performance ! I think unlang should have better performance in comparison to Perl

Re: unlang equivalent of radlog

2013-05-19 Thread Arran Cudbard-Bell
On 19 May 2013, at 12:47, Nasser Heidari nas...@rasana.net wrote: Hi, I have several Perl modules running on my Radius server, I'm going to remove them all and use unlang instead. I have two questions: 1- The reason that I'm going to change Perl modules with unlang is Performance

Re: unlang equivalent of radlog

2013-05-19 Thread Peter Lambrechtsen
On Mon, May 20, 2013 at 5:13 AM, Arran Cudbard-Bell a.cudba...@freeradius.org wrote: On 19 May 2013, at 12:47, Nasser Heidari nas...@rasana.net wrote: Hi, I have several Perl modules running on my Radius server, I'm going to remove them all and use unlang instead. I have two questions

RE: unlang equivalent of radlog

2013-05-19 Thread Nasser Heidari
mailing list Subject: Re: unlang equivalent of radlog On Mon, May 20, 2013 at 5:13 AM, Arran Cudbard-Bell a.cudba...@freeradius.org wrote: On 19 May 2013, at 12:47, Nasser Heidari nas...@rasana.net wrote: Hi, I have several Perl modules running on my Radius server, I'm going to remove them all

Re: Unlang comparing variable correctly

2013-05-07 Thread Tyller D
great! Thanks a lot Alan. On Fri, May 3, 2013 at 8:12 PM, Alan DeKok al...@deployingradius.comwrote: Tyller D wrote: The strange thing is if the variable is equal to 2147465216 then it does not enter that function. Why? I've pushed a fix to the v2.x.x branch on github. Alan

using unlang to rewrite framed-ip-address sent from LDAP

2013-05-07 Thread sebastien boucher
hello, i am trying to rewrite the framed-ip-address information that are given to radius via ldap to a null value currently many of our users have a fixed framed-ip-address value of 255.255.255.254 , since we will now be using radius and mysql to distribute IP i would like to change this

Re: using unlang to rewrite framed-ip-address sent from LDAP

2013-05-07 Thread A . L . M . Buxey
Hi, i am trying to rewrite the framed-ip-address information that are given to radius via ldap to a null value okay. but the unlang you showed us would have rewritten the control packet to have Framed-IP-Address of %{1.1.1.1} - which is wrong/invalid anyway. what does the rest of the debug

Re: using unlang to rewrite framed-ip-address sent from LDAP

2013-05-07 Thread Sebastien Boucher
to rewrite the framed-ip-address information that are given to radius via ldap to a null value okay. but the unlang you showed us would have rewritten the control packet to have Framed-IP-Address of %{1.1.1.1} - which is wrong/invalid anyway. what does the rest of the debug log look like where you

Unlang comparing variable correctly

2013-05-03 Thread Tyller D
Hi, I am trying to compare a variable in freeradius using unlang but it seems to not be working correctly, more than likely i've made a mistake but let me show you. ? Evaluating (control:IMS-ActiveDirectory == 0) - FALSE ++? if (control:IMS-ActiveDirectory == 0) - FALSE ++? if (control:IMS

Re: Unlang comparing variable correctly

2013-05-03 Thread k...@rice.edu
On Fri, May 03, 2013 at 05:03:41PM +0200, Tyller D wrote: Hi, I am trying to compare a variable in freeradius using unlang but it seems to not be working correctly, more than likely i've made a mistake but let me show you. ? Evaluating (control:IMS-ActiveDirectory == 0) - FALSE

Re: Unlang comparing variable correctly

2013-05-03 Thread Alan DeKok
Tyller D wrote: So as you can see it enters entering if (control:IMS-Data 0) {...}, as it says that IMS-Data is 0. Its not, so I echoed out the variable in the next line and its value is 3221197824... The strange thing is if the variable is equal to 2147465216 then it does not enter that

Re: Unlang comparing variable correctly

2013-05-03 Thread Alan DeKok
Tyller D wrote: The strange thing is if the variable is equal to 2147465216 then it does not enter that function. Why? I've pushed a fix to the v2.x.x branch on github. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: unlang and optimization

2013-04-26 Thread Jason Frisvold
Arran Cudbard-Bell wrote: Yes. In FreeRADIUS master branch. You can also do nice things like cache group membership. Excellent. Not supported, and won't be supported. Overloading of attributes like this is slated for deprecation in 3.0/1, at which point we'll just standardise on xlat

Re: unlang and optimization

2013-04-26 Thread Jason Frisvold
a.l.m.bu...@lboro.ac.uk wrote: are they your only groups? if so, one less call is a quick optimisation No, there are a bunch of groups.. 9 or 10 at the moment. I do need to put a default in there though, so your solution will still need to be used. :) you could make a call to python or PERL

unlang and optimization

2013-04-25 Thread Jason 'XenoPhage' Frisvold
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Greetings, I'm looking for some information on optimizing some of the configuration I've made in my freeradius 2.2.0 installation. Specifically, I need to set a variable based on the LDAP Group membership of a user. I'm doing this in the

Re: unlang and optimization

2013-04-25 Thread Arran Cudbard-Bell
On 25 Apr 2013, at 14:32, Jason 'XenoPhage' Frisvold xenoph...@godshell.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Greetings, I'm looking for some information on optimizing some of the configuration I've made in my freeradius 2.2.0 installation. Specifically, I

Re: unlang and optimization

2013-04-25 Thread A . L . M . Buxey
Hi, I'm looking for some information on optimizing some of the configuration I've made in my freeradius 2.2.0 installation. Specifically, I need to set a variable based on the LDAP Group membership of a user. I'm doing this in the post-auth section at the moment, which I think is

change Group-Name in unlang

2013-03-30 Thread Mehdi Ravanbakhsh
I can change Pool-Name in unlang after if condition but if i use Group-Name for change the group of user it not work !!! in authorize { sql if (notfound) { update control { Auth-Type := Accept Group-Name := Bad-User } } In rad group check table i define Bad-User := Pool-Name

Re: change Group-Name in unlang

2013-03-30 Thread Alan DeKok
Mehdi Ravanbakhsh wrote: I can change Pool-Name in unlang after if condition but if i use Group-Name for change the group of user it not work !!! Group and Group-Name do checks in the unix /etc/groups file. You CANNOT re-write them. Alan DeKok. - List info/subscribe/unsubscribe? See

Re: change Group-Name in unlang

2013-03-30 Thread Mehdi Ravanbakhsh
can i use Sql-Group in unlang? i use sql module and in sql database i can relate user to group, can i change user group in unlang ? On Sat, Mar 30, 2013 at 8:58 PM, Alan DeKok al...@deployingradius.comwrote: Mehdi Ravanbakhsh wrote: I can change Pool-Name in unlang after if condition

Re: change Group-Name in unlang

2013-03-30 Thread Mehdi Ravanbakhsh
Can i use : sql if (notfound) { update control { Auth-Type := Accept User-Profile = Bad-User-Profile } } is User-Profile is changeable in unlang or i just can change Pool name by : Pool-Name := Bad-User-Pool Best regards. On Sat, Mar 30, 2013 at 9:14 PM, Mehdi Ravanbakhsh baba

Re: unlang CONDITIONS and sql query

2013-03-26 Thread A . L . M . Buxey
Hi, I am create stored procedure in postgresql database named findout_cuncurrent_session_for_a_user_result that return Deny or Permit . please dont ask the same question - people have read it. or dont read the mailing list frequently. alan - List info/subscribe/unsubscribe? See

change Access-Reject output of module with unlang

2013-03-25 Thread Mehdi Ravanbakhsh
Dear ALL How change Access-Reject output of module with unlang in sites-enable to Access-Accept and do some update control ? I can not find what is the replay attribute of reject or accept to check in If condition and change them in update replay. and Do we have any reference

Re: change Access-Reject output of module with unlang

2013-03-25 Thread A . L . M . Buxey
Hi, How change Access-Reject output of module with unlang in sites-enable to Access-Accept and do some update control ? what method? you cant just 'Access-Accept' an EAP method that relies on the agreement between client and authentication server for the cipher keys etc alan - List

Re: change Access-Reject output of module with unlang

2013-03-25 Thread Phil Mayers
On 03/25/2013 09:14 AM, Mehdi Ravanbakhsh wrote: Dear ALL How change Access-Reject output of module with unlang in sites-enable to Access-Accept and do some update control ? I don't think you can. And as AlanB says, it probably won't work anyway - you can't force accept on challenge

Re: change Access-Reject output of module with unlang

2013-03-25 Thread Mehdi Ravanbakhsh
PM, Phil Mayers p.may...@imperial.ac.ukwrote: On 03/25/2013 09:14 AM, Mehdi Ravanbakhsh wrote: Dear ALL How change Access-Reject output of module with unlang in sites-enable to Access-Accept and do some update control ? I don't think you can. And as AlanB says, it probably won't work

Re: change Access-Reject output of module with unlang

2013-03-25 Thread Phil Mayers
On 25/03/13 11:16, Mehdi Ravanbakhsh wrote: You means that if modules such as SQL module in session section return reject i can not change that to accept and then update some control attribute ? I don't think so. and can i change sql module ?( i know SQL.conf but in that file i just can

Re: change Access-Reject output of module with unlang

2013-03-25 Thread Mehdi Ravanbakhsh
thanks On Mon, Mar 25, 2013 at 4:40 PM, Phil Mayers p.may...@imperial.ac.ukwrote: On 25/03/13 11:16, Mehdi Ravanbakhsh wrote: You means that if modules such as SQL module in session section return reject i can not change that to accept and then update some control attribute ? I don't

unlang CONDITIONS and sql query

2013-03-25 Thread Mehdi Ravanbakhsh
Hi All I am create stored procedure in postgresql database named findout_cuncurrent_session_for_a_user_result that return Deny or Permit . I need to call this procedure in session section but it not working i check all policy that be explaned in unlang man page but this is not working

unlang substring with nas-port-id

2013-03-20 Thread Łukasz Kopiszka
Hi, I'm receiving from SE100: NAS-Port-Id = 2/2 vlan-id 1001 clips 132019 How to extract number 1001 which will be used in code: switch extracted vlan-id { case 1000 { ... } case 1001 { ... } case 1002 { ... }

Re: unlang substring with nas-port-id

2013-03-20 Thread Kris
{ } case 1001 { } } } But you might need to double check the syntax in man unlang. Hopefully someone will correct me on this. Regards, Krzysztof On 20/03/13 09:57, Łukasz Kopiszka

Re: UnLang SQL query vs Perl SQL query

2013-03-05 Thread Phil Mayers
On 03/04/2013 10:29 PM, Mehdi Ravanbakhsh wrote: Many thanks for your replay. How i can call stored procedure in unlang ? It's just an SQL query. Use an SQL xlat: {%sql:select myproc('%{Arg1}')} - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

UnLang SQL query vs Perl SQL query

2013-03-04 Thread Mehdi Ravanbakhsh
Dear All I can use Unlang script and/or Perl module Script to do some select - update or insert in database BUT i need to know witch one is faster Perl module or UnLang ??? This is important because i have to many stress on database query . I use PostgreSQL by p5-DBI and p5-DBD-Pg

Re: UnLang SQL query vs Perl SQL query

2013-03-04 Thread Arran Cudbard-Bell
On 4 Mar 2013, at 15:56, Mehdi Ravanbakhsh baba...@gmail.com wrote: Dear All I can use Unlang script and/or Perl module Script to do some select - update or insert in database BUT i need to know witch one is faster Perl module or UnLang ??? This is important because i have

Re: UnLang SQL query vs Perl SQL query

2013-03-04 Thread Mehdi Ravanbakhsh
and change 3 check attribute in radcheck table and Unlang just work to execute perl script . so in this case i need to use Perl in general but i can use unlang and Perl to connect and update database by SQL query i need to know that which one is faster and which way has more performance : Perl

Re: UnLang SQL query vs Perl SQL query

2013-03-04 Thread Arran Cudbard-Bell
] . i use perl script to do some calculate and return 3 replay attribute and change 3 check attribute in radcheck table and Unlang just work to execute perl script . Ok. so in this case i need to use Perl in general but i can use unlang and Perl to connect and update database by SQL

Re: UnLang SQL query vs Perl SQL query

2013-03-04 Thread Mehdi Ravanbakhsh
Many thanks for your replay. How i can call stored procedure in unlang ? On Tue, Mar 5, 2013 at 1:50 AM, Arran Cudbard-Bell a.cudba...@freeradius.org wrote: On 4 Mar 2013, at 16:36, Mehdi Ravanbakhsh baba...@gmail.com wrote: I need to transfer one radacc Table record to another

Re: Passing regexps from SQL to unlang

2013-02-19 Thread Alan DeKok
Maxim S. Denisov wrote: Thank you for your reply. There are many NASes in many regions and translation rules for them are different, I wanted make translation configuration using my ERP interface. Using files for this I will have to manage NAS configuration in two places and have a huge

Passing regexps from SQL to unlang

2013-02-18 Thread Maxim S. Denisov
, parse it to several regexps and use them in unlang as regexps? - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: Passing regexps from SQL to unlang

2013-02-18 Thread Alan DeKok
. Can I fetch this field, parse it to several regexps and use them in unlang as regexps? Not really. And it's probably not a good idea, either. Databases are for storing bulk data, not policies. This is the kind of thing you'd do in unlang. Just write 5-6 rules with regexes. They should

Re: Passing regexps from SQL to unlang

2013-02-18 Thread Maxim S. Denisov
. Regards, Maxim Denisov 18.02.2013, в 19:53, Alan DeKok al...@deployingradius.com написал(а): Not really. And it's probably not a good idea, either. Databases are for storing bulk data, not policies. This is the kind of thing you'd do in unlang. Just write 5-6 rules with regexes

Authenticating users checking Huntgroup-Name in unlang

2012-12-05 Thread suggestme IT
client Primary_controller{ ipaddr = IP Address secret = password shortname = primary nastype = enterasys } In default inner_tunnel files configurations, unlang conditional checking are done under ldap files sub-sections of authorize section /usr/local/etc/raddb

Re: Using ldap_xlat in unlang with Chars not allowed in an ldap search

2012-09-20 Thread Phil Mayers
On 29/08/12 17:42, Phil Mayers wrote: There's no easy way to do this with the built-in LDAP code. When the xlat is called, it's called with one big string i.e. the un-escaped value is already inside the string, and can't be escaped. Actually, following this up: I'm wrong here, due to

RE: unlang time / date comparison

2012-09-19 Thread Franks Andy (RLZ) IT Systems Engineer
[mailto:freeradius-users-bounces+andy.franks=sath.nhs.uk@lists.freeradiu s.org] On Behalf Of Arran Cudbard-Bell Sent: 18 September 2012 23:05 To: FreeRadius users mailing list Subject: Re: unlang time / date comparison On 18 Sep 2012, at 22:38, Franks Andy \(RLZ\) IT Systems Engineer andy.fra

Re: unlang time / date comparison

2012-09-19 Thread Arran Cudbard-Bell
On 19 Sep 2012, at 08:50, Franks Andy (RLZ) IT Systems Engineer andy.fra...@sath.nhs.uk wrote: Thanks Arran, I'll give it a try. I did find something to do with %1 / %I (can't remember which) %1expands to the first regexp match, %l should expand to a UNIX timestamp. You'll be looking for

unlang time / date comparison

2012-09-18 Thread Franks Andy (RLZ) IT Systems Engineer
Hi, Hopefully a simple question. I've looked around for a while but can't find the answer to this. I'd like to be able to take a date/time from a sql database, use unlang (not a module) to compare it to the current time and make a decision based on the fact that it's, for example, less or more

Re: unlang time / date comparison

2012-09-18 Thread Arran Cudbard-Bell
On 18 Sep 2012, at 22:38, Franks Andy \(RLZ\) IT Systems Engineer andy.fra...@sath.nhs.uk wrote: Hi, Hopefully a simple question. I’ve looked around for a while but can’t find the answer to this. I’d like to be able to take a date/time from a sql database, use unlang (not a module

Re: *** GMX Spamverdacht *** unlang time / date comparison

2012-09-18 Thread SkyDiablo
Am 18.09.2012 23:38, schrieb Franks Andy (RLZ) IT Systems Engineer: unlang time / date comparison I'd like to be able to take a date/time from a sql database,use unlang (not a module) tocompare it to the current time and make a decision based on the fact that it's, for example,less or more

Re: *** GMX Spamverdacht *** unlang time / date comparison

2012-09-18 Thread Arran Cudbard-Bell
On 18 Sep 2012, at 23:05, SkyDiablo skydia...@gmx.net wrote: Am 18.09.2012 23:38, schrieb Franks Andy (RLZ) IT Systems Engineer: I’d like to be able to take a date/time from a sql database, use unlang (not a module) to compare it to the current time and make a decision based on the fact

Using ldap_xlat in unlang with Chars not allowed in an ldap search

2012-08-29 Thread Daniel Finger
Hi! I have a Problem using the ldap Module to search in the ldap Tree for a specific Attribute Containing a (. I am using FreeRadius (2.1.12) for 802.1X Authentification (EAP-TLS) which is working fine. After successful EAP Authentication, I want to check if the User has an Entry in the LDAP:

Re: Using ldap_xlat in unlang with Chars not allowed in an ldap search

2012-08-29 Thread Phil Mayers
On 29/08/12 16:00, Daniel Finger wrote: If I have searched correctly it should work if I rewrite the Attribute with \28 for ( and \29 for ) (as ascii string, not escaped :-)) Shouldn't that be %28 and %29? Relevant docs here are RFC 4516 section 2.1, which references RFC 3986 section 2.1.

Using unlang for authentication

2012-07-31 Thread Andrei Petru Mura
with that following some threads from that forum on similar issues, that sooner or later leads to unlang procedures. I also read the unlang's man page. But I can't understand how to deal with unlang. Can anyone help me to obtain what I need? What I need: I need that every authentication request

Re: Using unlang for authentication

2012-07-31 Thread Phil Mayers
: CarboSolutions-NotBefore = 20120801). I tried to deal with that following some threads from that forum on similar issues, that sooner or later leads to unlang procedures. I also read the unlang's man page. But I can't understand how to deal with unlang. Can anyone help me to obtain what I need? What I need: I

Re: Using unlang for authentication

2012-07-31 Thread Andrei Petru Mura
leads to unlang procedures. I also read the unlang's man page. But I can't understand how to deal with unlang. Can anyone help me to obtain what I need? What I need: I need that every authentication request, should contain an CarboSolutions-NotBefore field with current date. It isn't very

RE: Load-Balance VLAN assignment via unlang

2012-07-18 Thread Cotton, Jesse
: Tuesday, July 17, 2012 8:29 AM To: FreeRadius users mailing list Subject: Re: Load-Balance VLAN assignment via unlang On 17 Jul 2012, at 12:57, Cotton, Jesse wrote: Using FR as a central RADIUS server. One task it performs is dot1x auth. It forwards eap requests to one of several home servers which

  1   2   3   4   5   >