Run time variable in sql

Alexey Dotsenko lex at rwx.su
Tue Mar 27 13:27:06 CEST 2018


Hi, Rob

As a solution, you can patch the module rlm_sql:

diff -ru freeradius-server-3.0.12.orig/src/modules/rlm_sql/sql.c 
freeradius-server-3.0.12/src/modules/rlm_sql/sql.c
--- freeradius-server-3.0.12.orig/src/modules/rlm_sql/sql.c     
2016-09-29 18:19:48.000000000 +0300
+++ freeradius-server-3.0.12/src/modules/rlm_sql/sql.c  2016-12-20 
11:44:37.001299860 +0300
@@ -168,16 +168,13 @@
                         break;

                 /*
-                *      Mark the pair to be allocated later.
+                *      Take the unquoted string and mark the pair to be 
allocated later.
                  */
                 case T_BACK_QUOTED_STRING:
                         do_xlat = 1;

-                       /* FALL-THROUGH */
-
-               /*
-                *      Keep the original string.
-                */
+                       value = buf;
+                       break;
                 default:
                         value = row[3];
                         break;

Best regards,
Alex

On 27.03.2018 12:13, rob-ml at mailbox.org wrote:
> Hi,
> i am still looking for a solution, would that be an approach?
> 
>> That's artifact of source code (rlm_sql module - sql.c, string 131 in
>> 3.0.16 version):
>> 
>> ...
>> 
>> 		case T_BACK_QUOTED_STRING:
>> 			do_xlat = 1;
>> 
>> 			/* FALL-THROUGH */
>> 
>> 		/*
>> 		 *	Keep the original string.
>> 		 */
>> 		default:
>> 			value = row[3];
>> 			break;
>> 		}
>> ...
>> 
>> There really "Keep the original" - back-quoted string.
> 
> Best regards
> Rob
> 
> 
>> rob-ml at mailbox.org hat am 26. März 2018 um 17:50 geschrieben:
>> 
>> 
>> hey,
>> i don't think so, will turn out during testing.
>> 
>> best wishes
>> rob
>> 
>> > Alan Buxey <alan.buxey at gmail.com> hat am 26. März 2018 um 17:21 geschrieben:
>> >
>> >
>> > do you need quotes in the SQL row at all?
>> >
>> > alan
>> > -
>> > List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>> 
>> -
>> List info/subscribe/unsubscribe? See 
>> http://www.freeradius.org/list/users.html
> 
> -
> List info/subscribe/unsubscribe? See 
> http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list