Re: Case statement error
Franks Andy (RLZ) IT Systems Engineer wrote: > Hi again, > Sorry to bang on about this, but I'm struggling still. > Brand new machine, Ubuntu 13.04 server, never had freeradius installed > on it. Pulled from git, - (FreeRADIUS Version 3.1.0 (git #209982d), I didn't see the 3.1.0... At this point, you may want to be running from the 3.0.0 release, or the v3.0.x branch. There are NO new features in "master" (3.1.0) over 3.0.0. Our plan for 3.1.0 is to finish the conversion to "talloc", which may introduce instabilities. In contrast, 2.2.x and 3.0.x will have minimal changes. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
RE: Case statement error
Thank both, that's great news. I really need to teach myself some C.. Cheers Andy -Original Message- From: freeradius-users-bounces+andy.franks=sath.nhs...@lists.freeradius.org [mailto:[email protected] s.org] On Behalf Of [email protected] Sent: 14 October 2013 07:27 To: FreeRadius users mailing list Subject: Re: Case statement error Hi, > Ah... a fix wasn't pulled over from v3.0.x to master. I've just > done that now. server now starts with such switch/case config present. cheers! alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: Case statement error
Hi, > Ah... a fix wasn't pulled over from v3.0.x to master. I've just done > that now. server now starts with such switch/case config present. cheers! alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: Case statement error
[email protected] wrote: > this error is also present with 3.1.0 when using the provided > orginate-coa virtual-server - so its reproducable with a minimally > adjusted configuration (just drop originate-coa from sites-available > to sites-enabled) Ah... a fix wasn't pulled over from v3.0.x to master. I've just done that now. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: Case statement error
Hi, this error is also present with 3.1.0 when using the provided orginate-coa virtual-server - so its reproducable with a minimally adjusted configuration (just drop originate-coa from sites-available to sites-enabled) alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
RE: Case statement error
Hi again,
Sorry to bang on about this, but I'm struggling still.
Brand new machine, Ubuntu 13.04 server, never had freeradius installed
on it. Pulled from git, - (FreeRADIUS Version 3.1.0 (git #209982d), for
host x86_64-unknown-linux-gnu, built on Oct 13 2013 at 18:42:55)
./configure
Make
Make install
Nothing else except putting this in the authorize section of a brand new
default vs
switch "%{control:Tmp-String-0}" {
case "" {
update control {
Tmp-String-0 := "new value"
}
}
}
Same outcome :
# Loading authorize {...}
/usr/local/etc/raddb/sites-enabled/default[222]: "case" statements may
only appear within a "switch" section
/usr/local/etc/raddb/sites-enabled/default[222]: Failed to parse "case"
subsection.
/usr/local/etc/raddb/sites-enabled/default[220]: Errors parsing
authorize section.
It just can't be an old binary, guaranteed this machine has never been
near FR.
Any ideas?
Does anyone mind trying it?
Thanks
Andy
-Original Message-
From:
freeradius-users-bounces+andy.franks=sath.nhs...@lists.freeradius.org
[mailto:[email protected]
s.org] On Behalf Of Alan DeKok
Sent: 11 October 2013 18:59
To: FreeRadius users mailing list
Subject: Re: Case statement error
Franks Andy (RLZ) IT Systems Engineer wrote:
> I still get
> # Loading authorize {...}
> /usr/local/etc/raddb/sites-enabled/default[222]: "case" statements may
> only appear within a "switch" section
You need to upgrade your binary. You're not using the latest version.
Alan DeKok.
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: Case statement error
Franks Andy (RLZ) IT Systems Engineer wrote:
> I still get
> # Loading authorize {...}
> /usr/local/etc/raddb/sites-enabled/default[222]: "case" statements may
> only appear within a "switch" section
You need to upgrade your binary. You're not using the latest version.
Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
RE: Case statement error
Hi again.
I'm confused now. I've recompiled, renamed all old folder under
/usr/local and done a complete reinstall.
I've pared it all down and simply put
switch "%{control:Tmp-String-0}" {
case "" {
update control {
Tmp-String-0 := "new value"
}
}
}
In the default VS.
I still get
# Loading authorize {...}
/usr/local/etc/raddb/sites-enabled/default[222]: "case" statements may
only appear within a "switch" section
/usr/local/etc/raddb/sites-enabled/default[222]: Failed to parse "case"
subsection.
/usr/local/etc/raddb/sites-enabled/default[220]: Errors parsing
authorize section.
I'm running git #57e69c9
Sorry, but I can't see what I'm doing wrong!
Thanks
Andy
-Original Message-
From:
freeradius-users-bounces+andy.franks=sath.nhs...@lists.freeradius.org
[mailto:[email protected]
s.org] On Behalf Of Alan DeKok
Sent: 09 October 2013 15:26
To: FreeRadius users mailing list
Subject: Re: Case statement error
Franks Andy (RLZ) IT Systems Engineer wrote:
> Trying version #d166290 results in
Which is old. The bug has already been fixed.
Alan DeKok.
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: Case statement error
Franks Andy (RLZ) IT Systems Engineer wrote: > Trying version #d166290 results in Which is old. The bug has already been fixed. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Case statement error
Hi All. I have some code in an "sql" policy:
sql_check_user_present {
update control {
Tmp-String-0 := "%{sql_pwifi:SELECT COUNT(*) from voucher v left
join state s on v.id=s.voucher_id where v.id=s.voucher_id and
v.code='%{User-Name}' and (s.state='Inactive' or s.state='Active')}"
}
switch "%{control:Tmp-String-0}" {
case "0" {
update control {
User-RejectInformation := "Sorry, that voucher code is invalid
or has expired."
Debug-RejectInformation := "Voucher code not present in database
table, or voucher expired"
}
reject
}
case "1" {
noop
}
case {
# voucher has multiple table entries, oooh errr.
update control {
User-RejectInformation := "Sorry, there has been an error.
Please contact IT."
Debug-RejectInformation := "Multiple voucher codes the same, or
database error - SQL count not = 0 or 1. This should never happen due to
primary key constraint!"
}
reject
}
}
}
This works fine in 3.0, git version #f66d411, but I have a problem with
a regex related thing causing a segfault in that version and wouldn't
mind trying the latest version to see if it's fixed.
Trying version #d166290 results in
/usr/local/etc/raddb/policy.d/sql[6]: "case" statements may only appear
within a "switch" section
/usr/local/etc/raddb/policy.d/sql[6]: Failed to parse "case" subsection.
/usr/local/etc/raddb/policy.d/sql[5]: Failed to parse "switch"
subsection.
/usr/local/etc/raddb/sites-enabled/default[220]: Errors parsing
authorize section.
Do I need to change how the switch statement works? The unlang page
doesn't seem to have changed as far as I can tell.
Thanks
Andy
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

