plpgsql freeradius authentication function

Santiago Balaguer García santiagoawa at hotmail.com
Mon Oct 18 08:20:52 CEST 2010


In which statement do you implement this query?
 


Date: Sat, 16 Oct 2010 11:49:36 -0400
Subject: plpgsql freeradius authentication function
From: kakyea at gmail.com
To: freeradius-users at lists.freeradius.org

Hi

I have a plpgsql function being called from freeradius to do authentication but i keep getting
Access-Reject from radius although when i run the function without freeradius it works fine.
Please find below the function and how i call it

CREATE OR REPLACE FUNCTION try (your_name TEXT, tiger TEXT) RETURNS RECORD AS $$
       DECLARE
             users_rec RECORD;
           
          BEGIN
             if tiger = '0000'  then
    SELECT INTO users_rec * FROM aniradcheck WHERE username = your_name;
     else  
    SELECT INTO users_rec * FROM radcheck WHERE username = your_name;
     end if;
     RETURN users_rec.username;     
     END;

$$ LANGUAGE plpgsql;


SELECT id,username,attribute,op,value FROM try('7140944444','0000') as(id integer,username varchar,attribute varchar,op character,value varchar);


Appreciate if you can help
Thanks 

- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20101018/d574b565/attachment.html>


More information about the Freeradius-Users mailing list