unlang question

Alan DeKok aland at deployingradius.com
Thu Jul 5 18:01:01 CEST 2007


Enrik Berkhan wrote:
> Alan DeKok schrieb:
>> Enrik Berkhan wrote:
>>> But exactly adding the "ok = 1" makes it work. Have you tried it? May be
>>> it's a bug though ... :)
>>   Hmm... then I'm not sure I understand what the code is doing.
> 
> Currently, it works like so (if/elsif, with if condition evaluating to
> FALSE):

  After looking at it a little more:

 if (...) {
	ok = 1
  }

  That works because "ok" is a module name, and the "= 1" is ignored.
But it doesn't do what you want.  I've changed the code so it now prints
an error.

> And yes, the child->actions can be set in the if-block.

  Nope.  See the above bug.  It *looks* like they can be set, bit it
doesn't work.  The actions are set ONLY inside of a module section, such as
   sql {
     ok = 1
     ...
  }

  *everywhere* else they don't work.

> So, I think, if/elsif/else-blocks either need other defaults for their
> actions[] or if/elsif/else-blocks need another unroll: mechanism :)

  They should just start off with the result of the previous action.
I've committed a patch to make them do this.  If a module inside of an
"if" block changes the result, that's OK.  But the *default* for an "if"
block is to start off with the previous result.

  Please check current CVS.  In cases where it doesn't work, it should
now print an error.  This means that configurations you *think* work,
but which don't really work, will now print an error.

  Alan DeKok.



More information about the Freeradius-Devel mailing list