Hi, I need use the value from soh-server and use this value for condition check in the inner virtual server, but it looks, that the variable filled in the soh-server is only local, and is not possible use the value from this variable in the inner virtual server. simple scenario: SOME_ATTR is defined in dictionary as integer in mods-enabled/eap in peap section is enabled soh-server soh = yes soh_virtual_server = "soh-server" server soh-server { ... if (some condition) { update control { SOME_ATTR := some_value } ... } server inner-server { ... if ( &control:SOME_ATTR == 1 ) { do something } in debug I can see, that in the soh-server is filled the variable SOME_ATTR, but in inner-server, when should be evaluated the condition if ( &control: SOME_ATTR == 1 ), I receive error message "ERROR: Failed retrieving values required to evaluate condition". I tried use outer.control in soh-server, but without success. My question: is possible take value defined in soh-server and use this value for condition in inner-server? Thank for any idea, Petr Linke
Hi Alan, thank you for you answer, but in unlang documentation is written: Attributes may be referenced via the following syntax: Attribute-Name, Attribute-Name:TAG, Attribute-Name[NUM], list :Attribute-Name, list :Attribute-Name:TAG[NUM]. Where list is one of "request", "reply", "control", "proxy-request", "proxy-reply" or "outer.request", "outer.reply", "outer.control", "outer.proxy-request" or "outer.proxy-reply". So inner.control is not allowed. Petr ---------- Original e-mail ---------- From: Alan Buxey alan.buxey@gmail.com To: FreeRadius users mailing list freeradius-users@lists.freeradius.org Date: 16. 5. 2018 19:30:12 Subject: Re: unlang variable you'll probably need to just copy it to eg inner:control alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On May 17, 2018, at 1:51 PM, petr.linke@seznam.cz wrote:
Hi Alan, thank you for you answer, but in unlang documentation is written:
Attributes may be referenced via the following syntax: Attribute-Name, Attribute-Name:TAG, Attribute-Name[NUM], list :Attribute-Name, list :Attribute-Name:TAG[NUM]. Where list is one of "request", "reply", "control", "proxy-request", "proxy-reply" or "outer.request", "outer.reply", "outer.control", "outer.proxy-request" or "outer.proxy-reply".
So inner.control is not allowed.
Try outer.session-state, you're probably producing and consuming the values in different rounds. -Arran
Hi Arran, I tried put into soh-server: update outer.session-state { &SOME_ATTRIBUTE := some_value } now I can see, that in outer-server (default) the value for &SOME_ATTRIBUTE was restored to some_value, so in outer-server I can use this, but in inner- server I cannot restore &SOME_ATTRIBUTE - in debug I can see "session-state: No cached attributes". It looks, that soh-server "is on the same level" as inner-server, so inner-server is not parent of soh-server, and is not possible use outer.session-state for sending values from soh-server to inner -server. One way is - store value from soh-server in sql, and in the inner- server restore this via sql, but this is too "expensive" for system resources. Really very thanks for your answer, if you have any other idea, I'll be very glad. Petr ---------- Original e-mail ---------- From: Arran Cudbard-Bell <a.cudbardb@freeradius.org> To: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Date: 17. 5. 2018 14:04:44 Subject: Re: unlang & variable "
On May 17, 2018, at 1:51 PM, petr.linke@seznam.cz wrote:
Hi Alan, thank you for you answer, but in unlang documentation is written:
Attributes may be referenced via the following syntax: Attribute-Name, Attribute-Name:TAG, Attribute-Name[NUM], list :Attribute- Name, list :Attribute-Name:TAG[NUM]. Where list is one of "request", "reply", "control", "proxy-request", "proxy-reply" or "outer.request", "outer.reply", "outer.control", "outer.proxy-request" or "outer.proxy-reply".
So inner.control is not allowed.
Try outer.session-state, you're probably producing and consuming the values in different rounds. -Arran - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users. html"
On May 17, 2018, at 9:59 AM, <petr.linke@seznam.cz> <petr.linke@seznam.cz> wrote:
I tried put into soh-server: update outer.session-state { &SOME_ATTRIBUTE := some_value }
It's best to *understand* the problem. The solution is usually obvious. "trying" things means you're not understanding, just making random changes in the hope that it will work. That's a good way to get frustrated.
now I can see, that in outer-server (default) the value for &SOME_ATTRIBUTE was restored to some_value, so in outer-server I can use this, but in inner- server I cannot restore &SOME_ATTRIBUTE - in debug I can see "session-state: No cached attributes". It looks, that soh-server "is on the same level" as inner-server,
Yes.
so inner-server is not parent of soh-server, and is not possible use outer.session-state for sending values from soh-server to inner -server.
Why not? If they're both parented from the outer server, then it should work.
Really very thanks for your answer, if you have any other idea, I'll be very glad.
Post the FULL DEBUG OUTPUT. It's not helpful to post vague descriptions of what you *think* is happening. Only the full debug output describes exactly what's happening. Alan DeKok.
---------- Original e-mail ---------- From: Alan DeKok <aland@deployingradius.com> To: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Date: 17. 5. 2018 16:10:50 Subjectt: Re: unlang & variable Hi all, this will happen when the eyes are tired and then a stupid mistake is discovered ... I have mistyping in condition, I wrote outer.session_state: SOME_ATTIBUTE and should be outer.session-state:SOME_ATTRIBUTE. And referencing outer.session-state:SOME_ATTRIBUTE worked as expected. Alan, you are completely right with sending full debug, I only try save time and send only necessary informations. Very sorry for my stupid mistype. Many thanks for help, Petr "
On May 17, 2018, at 9:59 AM, <petr.linke@seznam.cz> <petr.linke@seznam.cz> wrote:
I tried put into soh-server: update outer.session-state { &SOME_ATTRIBUTE := some_value }
It's best to *understand* the problem. The solution is usually obvious. "trying" things means you're not understanding, just making random changes in the hope that it will work. That's a good way to get frustrated.
now I can see, that in outer-server (default) the value for &SOME_ ATTRIBUTE was restored to some_value, so in outer-server I can use this, but in inner- server I cannot restore &SOME_ATTRIBUTE - in debug I can see "session- state: No cached attributes". It looks, that soh-server "is on the same level" as
inner-server,
Yes.
so inner-server is not parent of soh-server, and is not possible use outer.session-state for sending values from soh-server to inner -server.
Why not? If they're both parented from the outer server, then it should work.
Really very thanks for your answer, if you have any other idea, I'll be very glad.
Post the FULL DEBUG OUTPUT. It's not helpful to post vague descriptions of what you *think* is happening. Only the full debug output describes exactly what's happening. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users. html"
On May 17, 2018, at 10:32 AM, petr.linke@seznam.cz wrote:
this will happen when the eyes are tired and then a stupid mistake is discovered ... I have mistyping in condition, I wrote outer.session_state: SOME_ATTIBUTE and should be outer.session-state:SOME_ATTRIBUTE.
It should complain if the attribute is mis-named or doesn't exist...
And referencing outer.session-state:SOME_ATTRIBUTE worked as expected.
That's good.
Alan, you are completely right with sending full debug, I only try save time and send only necessary informations. Very sorry for my stupid mistype.
That's what debug log is for. :) Alan DeKok.
participants (4)
-
Alan Buxey -
Alan DeKok -
Arran Cudbard-Bell -
petr.linke@seznam.cz