]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Note bad configuration
authorAlan T. DeKok <aland@freeradius.org>
Tue, 15 Mar 2011 08:34:54 +0000 (09:34 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 15 Mar 2011 08:34:54 +0000 (09:34 +0100)
The sqlcounter module does it's own expansion.  This doesn't
seem to work.

raddb/modules/sqlcounter_expire_on_login
src/modules/rlm_sqlcounter/rlm_sqlcounter.c

index 71c0eba658d4356120c2febf6a050a7c97d4a86f..c950169307009b088b2c31274f496ffe38e8a793 100644 (file)
 #
 #  This example is for MySQL.  Other SQL variants should be similar.
 #
+#  For versions prior to 2.1.11, this module defined the following
+#  expansion strings:
+#
+#      %k      key_name
+#      %S      sqlmod_inst
+#
+#  These SHOULD NOT be used.  If these are used in your configuration,
+#  they should be replaced by the following strings, which will work
+#  identically to the previous ones:
+#
+#      %k      ${key}
+#      %S      ${sqlmod-inst}
+#
 sqlcounter expire_on_login {
        counter-name = Expire-After-Initial-Login
        check-name = Expire-After
@@ -18,7 +31,7 @@ sqlcounter expire_on_login {
        reset = never
        query = "SELECT TIME_TO_SEC(TIMEDIFF(NOW(), acctstarttime)) \
                 FROM radacct \
-                WHERE UserName='%{%k}' \
+                WHERE UserName='%{${key}}' \
                 ORDER BY acctstarttime \
                 LIMIT 1;"
 }
index e6a75e69e01b69cd8ec7e8c9c3413477ef192886..6e49b9fd3d7304cd780db660fc21035b656c8557 100644 (file)
@@ -349,10 +349,12 @@ static int sqlcounter_expand(char *out, int outlen, const char *fmt, void *insta
                                q += strlen(q);
                                break;
                        case 'k': /* Key Name */
+                               DEBUG2("WARNING: Please replace '%%k' with '${key}'")
                                strlcpy(q, data->key_name, freespace);
                                q += strlen(q);
                                break;
                        case 'S': /* SQL module instance */
+                               DEBUG2("WARNING: Please replace '%%S' with '${sqlmod-inst}'")
                                strlcpy(q, data->sqlmod_inst, freespace);
                                q += strlen(q);
                                break;