what are the intended semantics of paircompare()?

John Dennis jdennis at redhat.com
Fri Aug 15 22:50:21 CEST 2008


I'm in the process of debugging a problem and it seems to me 
paircompare() (in src/main/valuepair.c) is returning the wrong result. 
But I might be ascribing the wrong semantics to the function. Here is 
what I think it's supposed to do, is this correct?

If any check attribute matches (according to it's operator) any 
attribute of the same attribute type in the request then return 0 else 
return ~0.

Phrased another way it's a short circuit "logical or", e.g. as long as 
something matches it succeeds.

If that is the intended semantics then I think there are couple of bugs 
in it and I'll provide a patch along with an explanation, otherwise 
could you set me straight on what it's behaviour is supposed to be?

Thanks!

-- 
John Dennis <jdennis at redhat.com>




More information about the Freeradius-Users mailing list