Fix typo in rlm_sql.c, need to use goto in group evaluation loop as continue still...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 28 Nov 2014 18:17:41 +0000 (13:17 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 28 Nov 2014 18:18:51 +0000 (13:18 -0500)
src/modules/rlm_sql/rlm_sql.c

index 7c8cc15..d619590 100644 (file)
@@ -537,13 +537,8 @@ static int sql_get_grouplist(rlm_sql_t *inst, rlm_sql_handle_t **handle, REQUEST
 
        entry = *phead = NULL;
 
-       if (!inst->config->groupmemb_query || (inst->config->groupmemb_query[0] == 0)) {
-               return 0;
-       }
-
-       if (radius_axlat(&expanded, request, inst->config->groupmemb_query, sql_escape_func, inst) < 0) {
-               return -1;
-       }
+       if (!inst->config->groupmemb_query) return 0;
+       if (radius_axlat(&expanded, request, inst->config->groupmemb_query, sql_escape_func, inst) < 0) return -1;
 
        ret = rlm_sql_select_query(handle, inst, expanded);
        talloc_free(expanded);
@@ -687,6 +682,7 @@ static rlm_rcode_t rlm_sql_process_groups(rlm_sql_t *inst, REQUEST *request, rlm
 
        entry = head;
        do {
+       next:
                pairstrcpy(sql_group, entry->name);
 
                if (inst->config->authorize_group_check_query && *inst->config->authorize_group_check_query) {
@@ -720,7 +716,7 @@ static rlm_rcode_t rlm_sql_process_groups(rlm_sql_t *inst, REQUEST *request, rlm
                                pairfree(&check_tmp);
                                entry = entry->next;
 
-                               continue;
+                               goto next;      /* != continue */
                        }
 
                        RDEBUG2("Group \"%s\": Conditional check items matched", entry->name);