how to have freeradius/unlang do two or more SQL statements at onetime

Dave Sinclair jmb287 at gmail.com
Mon Mar 16 15:14:23 CET 2009


Hi Arran,

Where might one find your patch ???

2009/3/16 Arran Cudbard-Bell <A.Cudbard-Bell at sussex.ac.uk>:
> Hi All,
>
> The old rlm_xlat function only supported SELECT statements, and threw up
> errors on any others.
>
> The patch Alan mentioned makes rlm_sql look for INSERT, DELETE and UPDATE
> keywords at the beginning of SQL statements. If one of these keywords is
> found and instead of expanding to the first row of the first column of the
> result, rlm_sql expands to the number of rows affected by the statement, and
> no longer throws an error.
>
> It is now therefore possible, to replicate most of the functionality of
> rlm_sql with unlang statements.
>
>
>>    Yes, only one gets executed. Try this:
>>
>>    postauth_query = "INSERT INTO ${authcheck_table} ... ; INSERT INTO
>>    ${usergroup_table} ... "
>>
>>    If that doesn't work you will have to do inserts with perl.
>
> You'll now be able to do them with unlang to :).
>
> Thanks,
> Arran
> --
> Arran Cudbard-Bell (A.Cudbard-Bell at sussex.ac.uk),
> Authentication, Authorisation and Accounting Officer,
> Infrastructure Services (IT Services),
> E1-1-08, Engineering 1, University Of Sussex, Brighton, BN1 9QT
> DDI+FAX: +44 1273 873900 | INT: 3900
> GPG: 86FF A285 1AA1 EE40 D228 7C2E 71A9 25BB 1E68 54A2
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>




More information about the Freeradius-Users mailing list