Hi,
This may seem a bit unusual, but I find myself in a situation where I need to update the SQL authorization database from a different RLM module than rlm_sql. That is, in my new RLM I'll want to update the radcheck and usergroup tables with data that will be used by a subsequent authorization attempt through rlm_sql. As you might expect, I prefer to use the APIs provided by rlm_sql, rather than reinvent the wheel. For reference, I'm using Freeradius 0.8.1, MySQL v3.23, Red Hat 7.3.


My question is what do I need to do to set this up from my new RLM, which APIs do I use, and how do I clean things up, if at all. Here's some more detail: I see that the instantiate block of rlm_sql creates a client socket to the database. Ideally I would like to use this socket from my new RLM - is that possible? It will be an invalid configuration for my new RLM to be turned on in radiusd.conf without sql also being turned on. If my RLM needs its own socket, I assume I can duplicate the rlm_sql_instantiate logic in my RLM's instantiate function? Or, maybe this is overkill and I should just use the APIs in mysql.h - what do you think?

Once I have the socket created, I need APIs to insert and update rows in the radius database tables. I didnt see any APIs for this in rlm_sql.h, which led to my question above about just using mysql.h APIs. Unfortunately I'm not a DB expert, and I didnt see any APIs there with red letter names like insert or update, so any quick pointers here would be helpful. Finally, if I can't reuse the rlm_sql socket, I'll need to clean up the one I created, which should not be a problem - I'll just add the close in my rlm_detach.

Regards,
Dave



- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to