|
1. The xlat stuff is all new to me, so an example here would really help. I looked around in the doc directory and didnt see much. It sounds like my new RLM module will have some pre-configured strings for the database access, something like "insertRadcheck = %{sql: INSERT into radcheck (UserName, Attribute, op, Value) values (%s1, %s2, %s3, %s4)". Then it would take this and pass it to radius_xlat as the format string, along with the value strings? (I'm not sure how that works.) Then I save the output of radius_xlat in the REQUEST? How does the RADIUS_ESCAPE_STRING function work? 2. Where do I save my data in the REQUEST? Unless there's a place for stuff like this, I can add another char* to the structure and keep it there. Then my post-auth would free the memory after it's done. 3. Once the rlm_sql post-auth function pulls the new stuff out of the REQUEST, it will need to do the insert or update. I took a look at sql_xlat and it appears to only support SELECTs. Also, the sql_* prototypes in rlm_sql.h dont have any insert or update methods. If I need to implement insert and update, is there something I can use as a guide? rlm_sql_query and rlm_sql_select_query look simple enough, but I assume there's a lot going on under the hood. If I write such a routine and call it later, I guess the sqlsocket is maintained somewhere, but I need to build the SQL_INST? Thanks for your help with this, Dave Alan DeKok wrote: Dave Mason <[EMAIL PROTECTED]> wrote: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.Is that subsequent, as in "another RADIUS request"?If so, you can set up a post-auth section for SQL, and your module can drop information into the REQUEST which the post-auth section can pick up, and use to update the database.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?Not really.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? - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html |
- how to access authorization database from a different RL... Dave Mason
- Re: how to access authorization database from a dif... Alan DeKok
- Re: how to access authorization database from a dif... Dave Mason
- Re: how to access authorization database from a... Alan DeKok
- Re: how to access authorization database from a... Nicolas Baradakis
- Re: how to access authorization database from a dif... Dave Mason
- Re: how to access authorization database from a... Nicolas Baradakis
