freeradius fail redundant
Arran Cudbard-Bell
a.cudbardb at freeradius.org
Tue Feb 2 16:54:00 CET 2016
> On Feb 2, 2016, at 10:39 AM, Herwin Weststrate <herwin at quarantainenet.nl> wrote:
>
> On 02-02-16 16:20, Дмитрий wrote:
>> mysql Stored procedure returns a "Query OK, 0 row affected"
>> radius believes it is not correct
>> so decided.
>>
>> in freeradius-server-2.2.9 / src / modules / rlm_sql / rlm_sql.c replaced
>>
>> -if ( numaffected < 1 ) {
>> -ret = RLM_MODULE_NOOP;
>> -}
>>
>> +if ( (numaffected < 1 && !strstr(querystr,"call")) || (numaffected < 0 && strstr(querystr,"call") ) ) {
>> +ret = RLM_MODULE_NOOP;
>> +}
>
> That looks like a terrible hack. If I had named my table accouting_call
> this would match too. And I'm not even sure if the return value could
> possibly be smaller that 0 (it calls a mysql function, which is
> documented as "Because mysql_affected_rows() returns an unsigned value,
> you can check for -1 by comparing the return value to (my_ulonglong)-1
> (or to (my_ulonglong)~0, which is equivalent).", because that makes
> everything clearer).
>
> I'm not sure how much alike stored procedures in mysql are compared to
> postgresql, but wouldn't it be easier to just return a value in that
> stored procedure?
This is actually fixed in v3.0.x, we distinguish between a constraint violation and no affected rows for MySQL.
We're no longer accepting patches of any kind for 2.2.x, it is End of Life.
-Arran
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20160202/1011b6c5/attachment.sig>
More information about the Freeradius-Users
mailing list