Reject User Pre-Proxy - SQL

Matthew Newton mcn at freeradius.org
Sun Apr 1 16:28:17 CEST 2018


On 1 April 2018 14:30:30 BST, Andrei Antonelli <andreirp at gmail.com> wrote:
>if (&User-Name == 'XXX at XXX') {
>                reject

&User-Name on the LHS.


>if ("%{sql:SELECT username FROM radcheckblock WHERE username =
>'%{User-Name}'}" == &User-Name) {

&User-Name on the RHS.


>policy.d/filter[20]:  ^ Cannot use attribute reference on right side of
>condition

>What would be the best way to do this filter?

Attribute needs to be on the left, just like the error says.

if (&User-Name == "%{sql:SELECT username FROM radcheckblock WHERE username = '%{User-Name}'}") {


-- 
Matthew



More information about the Freeradius-Users mailing list