users file and "!*" comparisons

Alan DeKok aland at deployingradius.com
Tue Aug 7 19:33:43 CEST 2007


Daniel Larsson wrote:
> I've encountered an unintuitive behaviour in the users file processing .
> I wanted to do something similar to:
> 
> DEFAULT Some-Attr !* "", Other-Attr !* ""
>         ...
> 
> I.e. if neither "Some-Attr" nor "Other-Attr" is present, it should
> match.

  No.  That is not the way it's documented.  See "man users".  Each item
in the check list is ANDed.  What you wrote is:

  Some-Attr doesn't exist AND some other attribute doesn't exist.

  If Some-Attr *does* exist, the first check fails, and the next one
isn't even looked at.

> Before I try to patch this, is this intended for some reason?

  It's both intended and documented.

  If you want more complex comparisons, see the CVS head.  There, you
can do:

  if (!Some-Attr || !Other-Attr) ...

  Which is what you seem to want.

  Alan DeKok.



More information about the Freeradius-Devel mailing list