Hi,

I have just been "getting to know" freeradius (using version 0.7), and 
ran into a minor problem... I wanted to use sql to set the attributes, 
but do the password authentication in another module, so I commented out 
  "authenticate_query" in sql.conf. This did not work... On closer 
inspection, rlm_sql.c has the test:

if (inst->config->authenticate_query){ ...

but in the config parsing a default of "" (empty string) is specified, 
so even if the config string is commented out, it still tries to 
authenticate. Changing this to:

if((inst->config->authenticate_query) &&
     (strlen(inst->config->authenticate_query) > 0)){...

works like a charm.  Attached is a patch to implement this change, if 
you want it.

Thanks,

-justin

PS. Aside from this glitch, my experience with freeradius is wholly 
positive. Well documented, easy to use, very flexible, etc... Great work!
--- freeradius-0.7/src/modules/rlm_sql/rlm_sql.c        Thu Jul 25 17:54:23 2002
+++ ../cellid/freeradius-0.7/src/modules/rlm_sql/rlm_sql.c      Tue Aug 13 12:59:00 
+2002
@@ -462,7 +462,7 @@
        pairfree(&reply_tmp);
        pairfree(&check_tmp);
 
-       if (inst->config->authenticate_query){
+       if ((inst->config->authenticate_query) && 
+(strlen(inst->config->authenticate_query) > 0)){
                radius_xlat(querystr, MAX_QUERY_LEN, inst->config->authenticate_query, 
request, sql_escape_func);
        
                /* Remove the username we (maybe) added above */

Reply via email to