]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
More debug macros
authorAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 17:16:22 +0000 (12:16 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 17:18:55 +0000 (12:18 -0500)
DEBUGE, DEBUGW, for errors / warnings.  RDEBUG*, too.

This lets the errors and warnings have a common format, so that
the messages don't need to use an explicit "WARNING" string.

It also means that they are now colorized:
warning = bold + yellow
error = bold + red

This should hopefully help people who have issues reading the
debug output

42 files changed:
src/include/radiusd.h
src/main/auth.c
src/main/client.c
src/main/command.c
src/main/conffile.c
src/main/detail.c
src/main/evaluate.c
src/main/listen.c
src/main/log.c
src/main/modcall.c
src/main/modules.c
src/main/process.c
src/main/realms.c
src/main/tls.c
src/main/tls_listen.c
src/main/valuepair.c
src/main/xlat.c
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_chap/rlm_chap.c
src/modules/rlm_detail/rlm_detail.c
src/modules/rlm_dhcp/rlm_dhcp.c
src/modules/rlm_digest/rlm_digest.c
src/modules/rlm_eap/eap.c
src/modules/rlm_eap/libeap/eap_tls.c
src/modules/rlm_eap/mem.c
src/modules/rlm_eap/rlm_eap.c
src/modules/rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c
src/modules/rlm_eap/types/rlm_eap_ikev2/ike_conf.c
src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c
src/modules/rlm_exec/rlm_exec.c
src/modules/rlm_files/rlm_files.c
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_opendirectory/rlm_opendirectory.c
src/modules/rlm_pap/rlm_pap.c
src/modules/rlm_preprocess/rlm_preprocess.c
src/modules/rlm_radutmp/rlm_radutmp.c
src/modules/rlm_radutmp/rlm_radutmp2.c
src/modules/rlm_replicate/rlm_replicate.c
src/modules/rlm_rest/rest.c
src/modules/rlm_sqlcounter/rlm_sqlcounter.c
src/modules/rlm_wimax/rlm_wimax.c

index b9196d73327afefc2f095b162438ffcbb6946e7b..c4c379ce6e296536562790100ed3becf1fb77830 100644 (file)
@@ -438,17 +438,33 @@ typedef struct main_config_t {
                                        //!< VT100 escape sequences.
 } MAIN_CONFIG_T;
 
-#define DEBUG  if(debug_flag)log_debug
-#define DEBUG2  if (debug_flag > 1)log_debug
-#define DEBUG3  if (debug_flag > 2)log_debug
-#define DEBUG4  if (debug_flag > 3)log_debug
+/* DEBUG is defined below */
+#define DEBUG3  if (debug_flag > 2) log_debug
+#define DEBUG4  if (debug_flag > 3) log_debug
 
 #if __GNUC__ >= 3
 #define RDEBUG(fmt, ...)   if(request && request->radlog) request->radlog(L_DBG, 1, request, fmt, ## __VA_ARGS__)
+#define RDEBUGW(fmt, ...)   if(request && request->radlog) request->radlog(L_DBG_WARN, 1, request, fmt, ## __VA_ARGS__)
+#define RDEBUGE(fmt, ...)   if(request && request->radlog) request->radlog(L_DBG_ERR, 1, request, fmt, ## __VA_ARGS__)
+
 #define RDEBUG2(fmt, ...)  if(request && request->radlog) request->radlog(L_DBG, 2, request, fmt, ## __VA_ARGS__)
+#define RDEBUG2W(fmt, ...)   if(request && request->radlog) request->radlog(L_DBG_WARN, 2, request, fmt, ## __VA_ARGS__)
+#define RDEBUG2E(fmt, ...)   if(request && request->radlog) request->radlog(L_DBG_ERR, 2, request, fmt, ## __VA_ARGS__)
+
 #define RDEBUG3(fmt, ...)  if(request && request->radlog) request->radlog(L_DBG, 3, request, fmt, ## __VA_ARGS__)
 #define RDEBUG4(fmt, ...)  if(request && request->radlog) request->radlog(L_DBG, 4, request, fmt, ## __VA_ARGS__)
+
+#define DEBUG(...)     if (debug_flag) radlog(L_DBG, ## __VA_ARGS__)
+#define DEBUGW(...)    if (debug_flag) radlog(L_DBG_WARN, ## __VA_ARGS__)
+#define DEBUGE(...)    if (debug_flag) radlog(L_DBG_ERR, ## __VA_ARGS__)
+
+#define DEBUG2  if (debug_flag > 1) log_debug
+#define DEBUG2W(...)  if (debug_flag > 1) radlog(L_DBG_WARN, ## __VA_ARGS__)
+
 #else
+#define DEBUG  if (debug_flag) log_debug
+#define DEBUG2  if (debug_flag > 1) log_debug
+
 #define RDEBUG  DEBUG
 #define RDEBUG2 DEBUG2
 #define RDEBUG3 DEBUG3
@@ -463,13 +479,19 @@ typedef struct main_config_t {
 #define RETRY_COUNT             3
 #define DEAD_TIME               120
 
-#define L_DBG                  1
 #define L_AUTH                 2
 #define L_INFO                 3
 #define L_ERR                  4
 #define L_PROXY                        5
 #define L_ACCT                 6
 
+#define L_DBG                  16
+#define L_DBG_WARN             17
+#define L_DBG_ERR              18
+#define L_DBG_WARN2            19
+#define L_DBG_ERR2             20
+
+
 /* for paircompare_register */
 typedef int (*RAD_COMPARE_FUNC)(void *instance, REQUEST *,VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR **);
 
index 14b39fd84b843fac1d8e94a2c75df2d089b5a7ad..19efe29ebbd7504bf39b5b0736faa5fbb273c2f4 100644 (file)
@@ -225,12 +225,12 @@ static int rad_check_password(REQUEST *request)
         */
        if (auth_type < 0) {
                if (pairfind(request->config_items, PW_CRYPT_PASSWORD, 0, TAG_ANY) != NULL) {
-                       RDEBUG2("WARNING: Please update your configuration, and remove 'Auth-Type = Crypt'");
-                       RDEBUG2("WARNING: Use the PAP module instead.");
+                       RDEBUG2W("Please update your configuration, and remove 'Auth-Type = Crypt'");
+                       RDEBUG2W("Use the PAP module instead.");
                }
                else if (pairfind(request->config_items, PW_CLEARTEXT_PASSWORD, 0, TAG_ANY) != NULL) {
-                       RDEBUG2("WARNING: Please update your configuration, and remove 'Auth-Type = Local'");
-                       RDEBUG2("WARNING: Use the PAP or CHAP modules instead.");
+                       RDEBUG2W("Please update your configuration, and remove 'Auth-Type = Local'");
+                       RDEBUG2W("Use the PAP or CHAP modules instead.");
                }
 
                /*
@@ -240,7 +240,7 @@ static int rad_check_password(REQUEST *request)
                 *      This is fail-safe.
                 */
 
-               RDEBUG2("ERROR: No authenticate method (Auth-Type) found for the request: Rejecting the user");
+               RDEBUG2E("No Auth-Type found: rejecting the user via Post-Auth-Type = Reject");
                return -2;
        }
 
@@ -506,11 +506,11 @@ autz_redo:
                 *      *the* LOCAL realm.
                 */
                if (realm &&(strcmp(realm->name, "LOCAL") != 0)) {
-                       RDEBUG2("WARNING: You set Proxy-To-Realm = %s, but it is a LOCAL realm!  Cancelling proxy request.", realm->name);
+                       RDEBUG2W("You set Proxy-To-Realm = %s, but it is a LOCAL realm!  Cancelling proxy request.", realm->name);
                }
 
                if (!realm) {
-                       RDEBUG2("WARNING: You set Proxy-To-Realm = %s, but the realm does not exist!  Cancelling invalid proxy request.", tmp->vp_strvalue);
+                       RDEBUG2W("You set Proxy-To-Realm = %s, but the realm does not exist!  Cancelling invalid proxy request.", tmp->vp_strvalue);
                }
        }
 
index 720b7582310a5f299565039f988a1f228c6b1926..9487a5571073a3ba050898f8a1987963cc9fd377 100644 (file)
@@ -336,7 +336,7 @@ int client_add(RADCLIENT_LIST *clients, RADCLIENT *client)
                    (old->coa_pool == client->coa_pool) &&
 #endif
                    (old->message_authenticator == client->message_authenticator)) {
-                       DEBUG("WARNING: Ignoring duplicate client %s", client->longname);
+                       DEBUGW("Ignoring duplicate client %s", client->longname);
                        client_free(client);
                        return 1;
                }
@@ -739,7 +739,7 @@ static RADCLIENT *client_parse(CONF_SECTION *cs, int in_server)
                        goto error;
                }
 #else
-               DEBUG("WARNING: Server not build with udpfromto, ignoring client src_ipaddr");
+               DEBUGW("Server not build with udpfromto, ignoring client src_ipaddr");
 #endif
                
                free(cl_srcipaddr);
@@ -1126,7 +1126,7 @@ RADCLIENT *client_create(RADCLIENT_LIST *clients, REQUEST *request)
                                c->src_ipaddr.af = AF_INET;
                                c->src_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr;
 #else
-                               DEBUG("WARNING: Server not build with udpfromto, ignoring FreeRADIUS-Client-Src-IP-Address.");
+                               DEBUGW("Server not build with udpfromto, ignoring FreeRADIUS-Client-Src-IP-Address.");
 #endif
                        }
                        
@@ -1142,7 +1142,7 @@ RADCLIENT *client_create(RADCLIENT_LIST *clients, REQUEST *request)
                                c->src_ipaddr.af = AF_INET6;
                                c->src_ipaddr.ipaddr.ip6addr = vp->vp_ipv6addr;
 #else
-                               DEBUG("WARNING: Server not build with udpfromto, ignoring FreeRADIUS-Client-Src-IPv6-Address.");
+                               DEBUGW("Server not build with udpfromto, ignoring FreeRADIUS-Client-Src-IPv6-Address.");
 #endif
                        }
                        
index ff0e057eff7c0668951e379565d611c5ffcab666..dc9456f102deb91092c2e746d6f0ddde0ae087dd 100644 (file)
@@ -1332,7 +1332,7 @@ static int command_inject_file(rad_listen_t *listener, int argc, char *argv[])
                        radlog(L_DBG, "\t%s", buffer);
                }
 
-               DEBUG("WARNING: INJECTION IS LEAKING MEMORY!");
+               DEBUGW("INJECTION IS LEAKING MEMORY!");
        }
 
        if (!request_receive(fake, packet, sock->inject_client, fun)) {
index 06e3e256ed99df6182259e94c4bfd28d188584a4..c4b384fe71de9a25b05d892cd651762fe1e7e8cb 100644 (file)
@@ -719,7 +719,7 @@ CONF_ITEM *cf_reference_item(const CONF_SECTION *parentcs,
        }
 
 no_such_item:
-       DEBUG2("WARNING: No such configuration item %s", ptr);
+       DEBUG2W("No such configuration item %s", ptr);
        return NULL;
 }
 
@@ -1635,7 +1635,7 @@ static int cf_section_read(const char *filename, int *lineno, FILE *fp,
                                        struct stat statbuf;
 
                                        if (stat(value, &statbuf) < 0) {
-                                               DEBUG("WARNING: Not including file %s: %s", value, strerror(errno));
+                                               DEBUGW("Not including file %s: %s", value, strerror(errno));
                                                continue;
                                        }
                                }
index 6892fdf7618952055d64e1e3c3bdc185f236b9a8..1981d1c229a7a62734ae62f19461ae20d8b5d2b3 100644 (file)
@@ -520,7 +520,7 @@ int detail_recv(rad_listen_t *listener)
                 *      FIXME: print an error for badly formatted attributes?
                 */
                if (sscanf(buffer, "%255s %8s %1023s", key, op, value) != 3) {
-                       DEBUG2("WARNING: Skipping badly formatted line %s",
+                       DEBUG2W("Skipping badly formatted line %s",
                               buffer);
                        continue;
                }
index e0f51dc38819266c75821538c5620c3a2b221f10..91c0bd8bf71aac79bde678e4fbcbdf3c26979ff8 100644 (file)
@@ -385,7 +385,7 @@ static int radius_do_cmp(REQUEST *request, int *presult,
                                char errbuf[128];
 
                                regerror(compare, &reg, errbuf, sizeof(errbuf));
-                               DEBUG("ERROR: Failed compiling regular expression: %s", errbuf);
+                               DEBUGE("Failed compiling regular expression: %s", errbuf);
                        }
                        return FALSE;
                }
@@ -440,7 +440,7 @@ static int radius_do_cmp(REQUEST *request, int *presult,
                                char errbuf[128];
 
                                regerror(compare, &reg, errbuf, sizeof(errbuf));
-                               DEBUG("ERROR: Failed compiling regular expression: %s", errbuf);
+                               DEBUGE("Failed compiling regular expression: %s", errbuf);
                        }
                        return FALSE;
                }
@@ -456,7 +456,7 @@ static int radius_do_cmp(REQUEST *request, int *presult,
 #endif
                
        default:
-               DEBUG("ERROR: Comparison operator %s is not supported",
+               DEBUGE("Comparison operator %s is not supported",
                      fr_token_name(token));
                result = FALSE;
                break;
@@ -1132,7 +1132,7 @@ int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs,
 
        request_name = radius_request_name(&name, REQUEST_CURRENT);
        if (request_name == REQUEST_UNKNOWN) {
-               RDEBUG("ERROR: Invalid request name");
+               RDEBUGE("Invalid request name");
                
                return RLM_MODULE_INVALID;
        }
@@ -1141,7 +1141,7 @@ int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs,
         *      Qualifiers not valid for this request
         */
        if (radius_request(&update_request, request_name) < 0) {
-               RDEBUG("WARNING: List name refers to outer request"
+               RDEBUGW("List name refers to outer request"
                       " but not in a tunnel.");
                return RLM_MODULE_NOOP; 
        }
@@ -1152,14 +1152,14 @@ int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs,
         *      Bad list name name
         */
        if (list == PAIR_LIST_UNKNOWN) {
-               RDEBUG("ERROR: Invalid list name '%s'", name);
+               RDEBUGE("Invalid list name '%s'", name);
                return RLM_MODULE_INVALID;
        }
        
        output_vps = radius_list(update_request, list);
        if (!output_vps) {
                if (!((list == PAIR_LIST_COA) || (list == PAIR_LIST_DM))) {
-                       RDEBUG("WARNING: List '%s' doesn't exist for this packet", name);
+                       RDEBUGW("List '%s' doesn't exist for this packet", name);
                        return RLM_MODULE_INVALID;
                }
 
@@ -1198,7 +1198,7 @@ int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs,
 #ifndef NDEBUG
                if (debug_flag && (vp->da->vendor == 0) &&
                    radius_find_compare(vp->da->attr)) {
-                       DEBUG("WARNING: You are modifying the value of virtual attribute %s.  This is not supported.", vp->da->name);
+                       DEBUGW("You are modifying the value of virtual attribute %s.  This is not supported.", vp->da->name);
                }
 #endif
 
@@ -1218,7 +1218,7 @@ int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs,
                        }
 
                        if (!pairparsevalue(vp, value)) {
-                               RDEBUG2("ERROR: Failed parsing value \"%s\" for attribute %s: %s",
+                               RDEBUG2E("Failed parsing value \"%s\" for attribute %s: %s",
                                       value, vp->da->name, fr_strerror());
                                pairfree(&newlist);
                                return RLM_MODULE_FAIL;
index 8139f0702bf84eed4a6035250d1a7d30900e64e0..f8024fd91e0f05a54316deb76eac4cdb525a74ea 100644 (file)
@@ -521,7 +521,7 @@ static int dual_tcp_recv(rad_listen_t *listener)
        case PW_STATUS_SERVER:
                if (!mainconfig.status_server) {
                        FR_STATS_INC(auth, total_unknown_types);
-                       DEBUG("WARNING: Ignoring Status-Server request due to security configuration");
+                       DEBUGW("Ignoring Status-Server request due to security configuration");
                        rad_free(&sock->packet);
                        return 0;
                }
@@ -1081,7 +1081,7 @@ static int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this)
                if (home_server_find(&sock->my_ipaddr, sock->my_port, sock->proto)) {
                                char buffer[128];
                                
-                               DEBUG("ERROR: We have been asked to listen on %s port %d, which is also listed as a home server.  This can create a proxy loop.",
+                               DEBUGE("We have been asked to listen on %s port %d, which is also listed as a home server.  This can create a proxy loop.",
                                      ip_ntoh(&sock->my_ipaddr, buffer, sizeof(buffer)),
                                      sock->my_port);
                                return -1;
@@ -1439,7 +1439,7 @@ static int auth_socket_recv(rad_listen_t *listener)
                if (!mainconfig.status_server) {
                        rad_recv_discard(listener->fd);
                        FR_STATS_INC(auth, total_unknown_types);
-                       DEBUG("WARNING: Ignoring Status-Server request due to security configuration");
+                       DEBUGW("Ignoring Status-Server request due to security configuration");
                        return 0;
                }
                fun = rad_status_server;
@@ -1521,7 +1521,7 @@ static int acct_socket_recv(rad_listen_t *listener)
                        rad_recv_discard(listener->fd);
                        FR_STATS_INC(acct, total_unknown_types);
 
-                       DEBUG("WARNING: Ignoring Status-Server request due to security configuration");
+                       DEBUGW("Ignoring Status-Server request due to security configuration");
                        return 0;
                }
                fun = rad_status_server;
@@ -1575,7 +1575,7 @@ static int do_proxy(REQUEST *request)
        if (!vp) return 0;
        
        if (!home_pool_byname(vp->vp_strvalue, HOME_TYPE_COA)) {
-               RDEBUG2("ERROR: Cannot proxy to unknown pool %s",
+               RDEBUG2E("Cannot proxy to unknown pool %s",
                        vp->vp_strvalue);
                return 0;
        }
@@ -1627,7 +1627,7 @@ static int rad_coa_recv(REQUEST *request)
                        if (vp && (vp->vp_integer == 17)) {
                                vp = pairfind(request->packet->vps, PW_STATE, 0, TAG_ANY);
                                if (!vp || (vp->length == 0)) {
-                                       RDEBUG("ERROR: CoA-Request with Service-Type = Authorize-Only MUST contain a State attribute");
+                                       RDEBUGE("CoA-Request with Service-Type = Authorize-Only MUST contain a State attribute");
                                        request->reply->code = PW_COA_NAK;
                                        return RLM_MODULE_FAIL;
                                }
@@ -1636,7 +1636,7 @@ static int rad_coa_recv(REQUEST *request)
                        /*
                         *      RFC 5176, Section 3.2.
                         */
-                       RDEBUG("ERROR: Disconnect-Request MUST NOT contain a Service-Type attribute");
+                       RDEBUGE("Disconnect-Request MUST NOT contain a Service-Type attribute");
                        request->reply->code = PW_DISCONNECT_NAK;
                        return RLM_MODULE_FAIL;
                }
@@ -2149,7 +2149,7 @@ static int listen_bind(rad_listen_t *this)
 #endif
 
                default:
-                       DEBUG("WARNING: Internal sanity check failed in binding to socket.  Ignoring problem.");
+                       DEBUGW("Internal sanity check failed in binding to socket.  Ignoring problem.");
                        return -1;
                }
        }
@@ -2527,7 +2527,7 @@ int proxy_new_listener(home_server *home, int src_port)
 
        if ((home->limit.max_connections > 0) &&
            (home->limit.num_connections >= home->limit.max_connections)) {
-               DEBUG("WARNING: Home server has too many open connections (%d)",
+               DEBUGW("Home server has too many open connections (%d)",
                      home->limit.max_connections);
                return 0;
        }
index 64e9e6fc48150cf1319f55d89254b4583196f639..c3ad41cd2b512e62bf4f9c34c8b6687752729edd 100644 (file)
@@ -46,10 +46,15 @@ static const FR_NAME_NUMBER levels[] = {
        { ": Info: ",           L_INFO  },
        { ": Acct: ",           L_ACCT  },
        { ": Error: ",          L_ERR   },
+       { ": WARNING: ",        L_DBG_WARN   },
+       { ": ERROR: ",          L_DBG_ERR   },
+       { ": WARNING: ",        L_DBG_WARN2   },
+       { ": ERROR: ",          L_DBG_ERR2   },
        { NULL, 0 }
 };
 
 #define VTC_RED                "\x1b[31m"
+#define VTC_YELLOW      "\x1b[33m"
 #define VTC_BOLD       "\x1b[1m"
 #define VTC_RESET      "\x1b[0m"
 
@@ -60,6 +65,10 @@ static const FR_NAME_NUMBER colours[] = {
        { VTC_BOLD,             L_INFO  },
        { VTC_BOLD,             L_ACCT  },
        { VTC_RED,              L_ERR   },
+       { VTC_BOLD VTC_RED,     L_DBG_ERR   },
+       { VTC_BOLD VTC_YELLOW,  L_DBG_WARN  },
+       { VTC_BOLD VTC_RED,     L_DBG_ERR2  },
+       { VTC_BOLD VTC_YELLOW,  L_DBG_WARN2 },
        { NULL, 0 }
 };
 
@@ -83,7 +92,7 @@ int vradlog(int lvl, const char *fmt, va_list ap)
         *
         *      Throw the message away.
         */
-       if (!debug_flag && (lvl == L_DBG)) {
+       if (!debug_flag && ((lvl & L_DBG) != 0)) {
                return 0;
        }
 
@@ -129,6 +138,19 @@ int vradlog(int lvl, const char *fmt, va_list ap)
                               sizeof(buffer) - len);
        }
 
+       switch (lvl) {
+       case L_DBG_WARN:
+               len += strlcpy(buffer + len, "WARNING: ", sizeof(buffer) - len);
+               break;
+
+       case L_DBG_ERR:
+               len += strlcpy(buffer + len, "ERROR: ", sizeof(buffer) - len);
+               break;
+
+       default:
+               break;
+       }
+
        if (len < sizeof(buffer)) {
                len += vsnprintf(buffer + len,
                                 sizeof(buffer) - len - 1, fmt, ap);
@@ -163,6 +185,8 @@ int vradlog(int lvl, const char *fmt, va_list ap)
        case RADLOG_SYSLOG:
                switch(lvl) {
                        case L_DBG:
+                       case L_DBG_WARN:
+                       case L_DBG_ERR:
                                lvl = LOG_DEBUG;
                                break;
                        case L_AUTH:
@@ -249,13 +273,14 @@ void radlog_request(int lvl, int priority, REQUEST *request, const char *msg, ..
        va_list ap;
        char buffer[8192];
        char *p;
+       const char *extra = "";
 
        va_start(ap, msg);
 
        /*
         *      Debug messages get treated specially.
         */
-       if (lvl == L_DBG) {
+       if ((lvl & L_DBG) != 0) {
                /*
                 *      There is log function, but the debug level
                 *      isn't high enough.  OR, we're in debug mode,
@@ -350,11 +375,25 @@ void radlog_request(int lvl, int priority, REQUEST *request, const char *msg, ..
        vsnprintf(buffer + len, sizeof(buffer) - len, msg, ap);
        
        finish:
+       switch (lvl) {
+       case L_DBG_WARN:
+               extra = "WARNING: ";
+               lvl = L_DBG_WARN2;
+               break;
+
+       case L_DBG_ERR:
+               extra = "ERROR: ";
+               lvl = L_DBG_ERR2;
+               break;
+
+               break;
+       }
+
        if (!fp) {
                if (request) {
-                       radlog(lvl, "(%u) %s", request->number, buffer);
+                       radlog(lvl, "(%u) %s%s", request->number, extra, buffer);
                } else {
-                       radlog(lvl, "%s", buffer);
+                       radlog(lvl, "%s%s", extra, buffer);
                }
        } else {
                if (request) fprintf(fp, "(%u) ", request->number);
index 6ad3bcfadfaf3dac4409f41fe94713868e59c1e1..003cf6befc756fb4c626d0e87735ec6ae01d4273 100644 (file)
@@ -543,7 +543,7 @@ int modcall(int component, modcallable *c, REQUEST *request)
                        }
 
                        if (depth < 0) {
-                               RDEBUG("ERROR: foreach Nesting too deep!");
+                               RDEBUGE("foreach Nesting too deep!");
                                myresult = RLM_MODULE_FAIL;
                                goto handle_result;
                        }
@@ -605,7 +605,7 @@ int modcall(int component, modcallable *c, REQUEST *request)
                        const char *server = request->server;
 
                        if (server == mr->ref_name) {
-                               RDEBUG("WARNING: Suppressing recursive call to server %s", server);
+                               RDEBUGW("Suppressing recursive call to server %s", server);
                                myresult = RLM_MODULE_NOOP;
                                goto handle_priority;
                        }
@@ -2430,8 +2430,6 @@ void modcallable_free(modcallable **pc)
        modcallable *c, *loop, *next;
        c = *pc;
 
-       DEBUG3("Freeing module %s", c->name);
-
        if (c->type != MOD_SINGLE) {
                modgroup *g = mod_callabletogroup(c);
 
index 0c8a3b22afd195c62122ec108ac61a8ed8315f63..f28f0419cf4955ff3b3af125f51aada1db39c61b 100644 (file)
@@ -402,7 +402,7 @@ static void module_instance_free_old(CONF_SECTION *cs, module_instance_t *node,
                
                if (node->entry->module->detach) {
                        if ((node->entry->module->detach)(mh->insthandle) < 0) {
-                               DEBUG("WARNING: Failed detaching module %s cleanly.  Doing forcible shutdown", node->name);
+                               DEBUGW("Failed detaching module %s cleanly.  Doing forcible shutdown", node->name);
 
                        }
                } else {
@@ -778,7 +778,7 @@ rlm_rcode_t indexed_modcall(int comp, int idx, REQUEST *request)
 
        if (idx == 0) {
                list = server->mc[comp];
-               if (!list) RDEBUG2("  WARNING: Empty %s section.  Using default return values.", section_type_value[comp].section);
+               if (!list) RDEBUG2W("Empty %s section.  Using default return values.", section_type_value[comp].section);
 
        } else {
                indexed_modcallable *this;
@@ -787,7 +787,7 @@ rlm_rcode_t indexed_modcall(int comp, int idx, REQUEST *request)
                if (this) {
                        list = this->modulelist;
                } else {
-                       RDEBUG2("  WARNING: Unknown value specified for %s.  Cannot perform requested action.",
+                       RDEBUG2W("Unknown value specified for %s.  Cannot perform requested action.",
                                section_type_value[comp].typename);
                }
        }
@@ -969,7 +969,7 @@ static int load_component_section(CONF_SECTION *cs,
                 *      It's OK for the module to not exist.
                 */
                if (!this && modname && (modname[0] == '-')) {
-                       DEBUG("WARNING: Not loading module \"%s\" as it is not enabled", modname + 1);
+                       DEBUGW("Not loading module \"%s\" as it is not enabled", modname + 1);
                        continue;
                }
 
@@ -1255,7 +1255,7 @@ static int load_byserver(CONF_SECTION *cs)
        cf_log_info(cs, "} # server");
 
        if (!flag && name) {
-               DEBUG("WARNING: Server %s is empty, and will do nothing!",
+               DEBUGW("Server %s is empty, and will do nothing!",
                      name);
        }
 
index 4e8925cb0659aad2713435156b4a9672b6db7bf3..b78e1a496cda3558c6ac29c1d8548a02917aca05 100644 (file)
@@ -657,7 +657,7 @@ static void request_process_timer(REQUEST *request)
                 *      there is no point in continuing.
                 */
                if (request->listener->status != RAD_LISTEN_STATUS_KNOWN) {
-                       DEBUG("WARNING: Socket was closed while processing request %u: Stopping it.", request->number);
+                       DEBUGW("Socket was closed while processing request %u: Stopping it.", request->number);
                        goto done;
                }
        }
@@ -1722,7 +1722,7 @@ retry:
 
                tries++;
                if (tries > 2) {
-                       RDEBUG2("ERROR: Failed allocating Id for new socket when proxying requests.");
+                       RDEBUG2E("Failed allocating Id for new socket when proxying requests.");
                        return 0;
                }
                
@@ -2009,7 +2009,7 @@ static int setup_post_proxy_fail(REQUEST *request)
                dval = dict_valbyname(PW_POST_PROXY_TYPE, 0, "Fail-Disconnect");
 #endif
        } else {
-               DEBUG("WARNING: Unknown packet type in Post-Proxy-Type Fail: ignoring");
+               DEBUGW("Unknown packet type in Post-Proxy-Type Fail: ignoring");
                request_cleanup_delay_init(request, NULL);
                return 0;
        }
@@ -2099,7 +2099,7 @@ static int request_will_proxy(REQUEST *request)
        if (vp) {
                realm = realm_find2(vp->vp_strvalue);
                if (!realm) {
-                       RDEBUG2("ERROR: Cannot proxy to unknown realm %s",
+                       RDEBUG2E("Cannot proxy to unknown realm %s",
                                vp->vp_strvalue);
                        return 0;
                }
@@ -2159,7 +2159,7 @@ static int request_will_proxy(REQUEST *request)
        }
        
        if (!pool) {
-               RDEBUG2(" WARNING: Cancelling proxy as no home pool exists");
+               RDEBUG2W("Cancelling proxy as no home pool exists");
                return 0;
        }
 
@@ -2167,7 +2167,7 @@ static int request_will_proxy(REQUEST *request)
 
        home = home_server_ldb(realmname, pool, request);
        if (!home) {
-               RDEBUG2("ERROR: Failed to find live home server: Cancelling proxy");
+               RDEBUG2E("Failed to find live home server: Cancelling proxy");
                return 0;
        }
        home_server_update_request(home, request);
@@ -2315,7 +2315,7 @@ static int request_proxy(REQUEST *request, int retransmit)
 
 #ifdef WITH_COA
        if (request->coa) {
-               RDEBUG("WARNING: Cannot proxy and originate CoA packets at the same time.  Cancelling CoA request");
+               RDEBUGW("Cannot proxy and originate CoA packets at the same time.  Cancelling CoA request");
                request_done(request->coa, FR_ACTION_DONE);
        }
 #endif
@@ -2401,7 +2401,7 @@ static int request_proxy_anew(REQUEST *request)
         */
        home = home_server_ldb(NULL, request->home_pool, request);
        if (!home) {
-               RDEBUG2("ERROR: Failed to find live home server for request");
+               RDEBUG2E("Failed to find live home server for request");
        post_proxy_fail:
                remove_from_proxy_hash(request);
 
@@ -2714,7 +2714,7 @@ static void mark_home_server_zombie(home_server *home)
 
 #ifdef WITH_TCP
        if (home->proto == IPPROTO_TCP) {
-               DEBUG("WARNING: Not marking TCP server %s zombie", home->name);
+               DEBUGW("Not marking TCP server %s zombie", home->name);
                return;
        }
 #endif
@@ -2778,7 +2778,7 @@ void mark_home_server_dead(home_server *home, struct timeval *when)
 
 #ifdef WITH_TCP
        if (home->proto == IPPROTO_TCP) {
-               DEBUG("WARNING: Not marking TCP server dead");
+               DEBUGW("Not marking TCP server dead");
                return;
        }
 #endif
@@ -3046,7 +3046,7 @@ static void request_coa_originate(REQUEST *request)
                coa->home_pool = home_pool_byname(vp->vp_strvalue,
                                                  HOME_TYPE_COA);
                if (!coa->home_pool) {
-                       RDEBUG2("WARNING: No such home_server_pool %s",
+                       RDEBUG2W("No such home_server_pool %s",
                               vp->vp_strvalue);
                        goto fail;
                }
@@ -3074,7 +3074,7 @@ static void request_coa_originate(REQUEST *request)
        if (coa->home_pool) {
                coa->home_server = home_server_ldb(NULL, coa->home_pool, coa);
                if (!coa->home_server) {
-                       RDEBUG("WARNING: No live home server for home_server_pool %s", vp->vp_strvalue);
+                       RDEBUGW("No live home server for home_server_pool %s", vp->vp_strvalue);
                        goto fail;
                }
                home_server_update_request(coa->home_server, coa);
@@ -3087,7 +3087,7 @@ static void request_coa_originate(REQUEST *request)
 
                coa->home_server = home_server_find(&ipaddr, port, IPPROTO_UDP);
                if (!coa->home_server) {
-                       RDEBUG2("WARNING: Unknown destination %s:%d for CoA request.",
+                       RDEBUG2W("Unknown destination %s:%d for CoA request.",
                               inet_ntop(ipaddr.af, &ipaddr.ipaddr,
                                         buffer, sizeof(buffer)), port);
                        goto fail;
index 651d2555129b16a80c6ee3cd9d31397fbb993dea..2e463b300d69f948972022871388a916e4f976a6 100644 (file)
@@ -1735,7 +1735,7 @@ static int realm_add(realm_config_t *rc, CONF_SECTION *cs)
                    ((cp = cf_pair_find(cs, "accthost")) != NULL) ||
                    ((cp = cf_pair_find(cs, "secret")) != NULL) ||
                    ((cp = cf_pair_find(cs, "ldflag")) != NULL)) {
-                       DEBUG2("WARNING: Ignoring old-style configuration entry \"%s\" in realm \"%s\"", cf_pair_attr(cp), r->name);
+                       DEBUG2W("Ignoring old-style configuration entry \"%s\" in realm \"%s\"", cf_pair_attr(cp), r->name);
                }
 
 
@@ -2366,7 +2366,7 @@ home_server *home_server_ldb(const char *realmname,
        if (!found && pool->fallback) {
                found = pool->fallback;
 
-               DEBUG("WARNING: Home server pool %s failing over to fallback %s",
+               DEBUGW("Home server pool %s failing over to fallback %s",
                      pool->name, found->server);
                if (pool->in_fallback) goto update_and_return;
 
index f69f5b469d3b336fb7e8802873c8e6f7b108cf75..ff533e35d374701d2e8cf04b744289a05612ad58 100644 (file)
@@ -932,8 +932,8 @@ static int load_dh_params(SSL_CTX *ctx, char *file)
        dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
        BIO_free(bio);
        if (!dh) {
-               DEBUG2("WARNING: rlm_eap_tls: Unable to set DH parameters.  DH cipher suites may not work!");
-               DEBUG2("WARNING: Fix this by running the OpenSSL command listed in eap.conf");
+               DEBUG2W("rlm_eap_tls: Unable to set DH parameters.  DH cipher suites may not work!");
+               DEBUG2W("Fix this by running the OpenSSL command listed in eap.conf");
                return 0;
        }
 
@@ -2512,7 +2512,7 @@ int tls_success(tls_session_t *ssn, REQUEST *request)
                                }
                        }
                } else {
-                       RDEBUG2("WARNING: No information to cache: session caching will be disabled for session %s", buffer);
+                       RDEBUG2W("No information to cache: session caching will be disabled for session %s", buffer);
                        SSL_CTX_remove_session(ssn->ctx,
                                               ssn->ssl->session);
                }
@@ -2534,7 +2534,7 @@ int tls_success(tls_session_t *ssn, REQUEST *request)
                vps = SSL_SESSION_get_ex_data(ssn->ssl->session,
                                             FR_TLS_EX_INDEX_VPS);
                if (!vps) {
-                       RDEBUG("WARNING: No information in cached session %s", buffer);
+                       RDEBUGW("No information in cached session %s", buffer);
                        return -1;
 
                } else {
@@ -2652,7 +2652,7 @@ fr_tls_status_t tls_application_data(tls_session_t *ssn,
        }
        
        if (err == 0) {
-               RDEBUG("WARNING: No data inside of the tunnel.");
+               RDEBUGW("No data inside of the tunnel.");
        }
        
        /*
index 7c9402285767eaf8e97141f3dd49b1ba89d55d60..3d48054adeb10c265406ffa3cd449b5fbac4bb34 100644 (file)
@@ -367,7 +367,7 @@ int dual_tls_recv(rad_listen_t *listener)
        case PW_STATUS_SERVER:
                if (!mainconfig.status_server) {
                        FR_STATS_INC(auth, total_unknown_types);
-                       DEBUG("WARNING: Ignoring Status-Server request due to security configuration");
+                       DEBUGW("Ignoring Status-Server request due to security configuration");
                        rad_free(&sock->packet);
                        request->packet = NULL;
                        return 0;
index b4912aa6fc775e7448ac2da9c50b23a519f45c1e..b0f662dc267e0d960dc1315601275ea181471caa 100644 (file)
@@ -518,9 +518,9 @@ int paircompare(REQUEST *request, VALUE_PAIR *req_list, VALUE_PAIR *check,
                         */
                        case PW_USER_PASSWORD:
                                if (check_item->op == T_OP_CMP_EQ) {
-                                       DEBUG("WARNING: Found User-Password == \"...\".");
-                                       DEBUG("WARNING: Are you sure you don't mean Cleartext-Password?");
-                                       DEBUG("WARNING: See \"man rlm_pap\" for more information.");
+                                       DEBUGW("Found User-Password == \"...\".");
+                                       DEBUGW("Are you sure you don't mean Cleartext-Password?");
+                                       DEBUGW("See \"man rlm_pap\" for more information.");
                                }
                                if (pairfind(req_list, PW_USER_PASSWORD, 0, TAG_ANY) == NULL) {
                                        continue;
@@ -982,7 +982,7 @@ VALUE_PAIR **radius_list(REQUEST *request, pair_lists_t list)
 #endif
        }
        
-       RDEBUG2("WARNING: List \"%s\" is not available",
+       RDEBUG2W("List \"%s\" is not available",
                fr_int2str(pair_lists, list, "<INVALID>"));
        
        return NULL;
@@ -1061,7 +1061,7 @@ int radius_request(REQUEST **context, request_refs_t name)
                case REQUEST_PARENT:    /* for future use in request chaining */
                case REQUEST_OUTER:
                        if (!request->parent) {
-                               RDEBUG("WARNING: Specified request \"%s\" is "
+                               RDEBUGW("Specified request \"%s\" is "
                                       "not available in this context",
                                       fr_int2str(request_refs, name,
                                                  "¿unknown?"));
@@ -1529,7 +1529,7 @@ int radius_map2request(REQUEST *request, const value_pair_map_t *map,
        char buffer[MAX_STRING_LEN];
        
        if (radius_request(&request, map->dst->request) < 0) {
-               RDEBUG("WARNING: Mapping \"%s\" -> \"%s\" "
+               RDEBUGW("Mapping \"%s\" -> \"%s\" "
                       "invalid in this context, skipping!",
                       map->src->name, map->dst->name);
                
@@ -1538,7 +1538,7 @@ int radius_map2request(REQUEST *request, const value_pair_map_t *map,
        
        list = radius_list(request, map->dst->list);
        if (!list) {
-               RDEBUG("WARNING: Mapping \"%s\" -> \"%s\" "
+               RDEBUGW("Mapping \"%s\" -> \"%s\" "
                       "invalid in this context, skipping!",
                       map->src->name, map->dst->name);
                       
index dc26959167ed26f42d41ee7ea6b6a5ea006fae19..ee79b8f89a5100b91acda49bd1323112f79703c8 100644 (file)
@@ -982,7 +982,7 @@ static int decode_attribute(const char **from, char **to, int freespace,
         */
        varlen = rad_copy_variable(buffer, *from);
        if (varlen < 0) {
-               RDEBUG2("ERROR: Badly formatted variable: %s", *from);
+               RDEBUG2E("Badly formatted variable: %s", *from);
                return -1;
        }
        *from += varlen;
@@ -1013,7 +1013,7 @@ static int decode_attribute(const char **from, char **to, int freespace,
                 */
                len1 = rad_copy_variable(buffer, p);
                if (len1 < 0) {
-                       RDEBUG2("ERROR: Badly formatted variable: %s", p);
+                       RDEBUG2E("Badly formatted variable: %s", p);
                        return -1;
                }
 
@@ -1046,7 +1046,7 @@ static int decode_attribute(const char **from, char **to, int freespace,
                        len2 = rad_copy_variable(l, p);
 
                        if (len2 < 0) {
-                               RDEBUG2("ERROR: Invalid text after :- at %s", p);
+                               RDEBUG2E("Invalid text after :- at %s", p);
                                return -1;
                        }
                        p += len2;
@@ -1128,7 +1128,7 @@ static int decode_attribute(const char **from, char **to, int freespace,
         *      Maybe it's the old-style %{foo:-bar}
         */
        if (*p == '-') {
-               RDEBUG2("WARNING: Deprecated conditional expansion \":-\".  See \"man unlang\" for details");
+               RDEBUG2W("Deprecated conditional expansion \":-\".  See \"man unlang\" for details");
                p++;
 
                xlat_str = module_name;
@@ -1162,9 +1162,9 @@ do_xlat:
        }
        if (!c) {
                if (!module_name) {
-                       RDEBUG2("WARNING: Unknown Attribute \"%s\" in string expansion \"%%%s\"", xlat_str, *from);
+                       RDEBUG2W("Unknown Attribute \"%s\" in string expansion \"%%%s\"", xlat_str, *from);
                } else {
-                       RDEBUG2("WARNING: Unknown module \"%s\" in string expansion \"%%%s\"", module_name, *from);
+                       RDEBUG2W("Unknown module \"%s\" in string expansion \"%%%s\"", module_name, *from);
                }
                return -1;
        }
@@ -1410,7 +1410,7 @@ size_t radius_xlat(char *out, int outlen, const char *fmt,
                                p++;
                                break;
                        default:
-                               RDEBUG2("WARNING: Unknown variable '%%%c': See 'doc/variables.txt'", *p);
+                               RDEBUG2W("Unknown variable '%%%c': See 'doc/variables.txt'", *p);
                                if (freespace > 2) {
                                        *q++ = '%';
                                        *q++ = *p++;
index 921e7b32cf1bedc74208a0bee13df0ca5ce3bc57..81bb09605cab38ebd134a0d7412b1b957c86e38c 100644 (file)
@@ -371,7 +371,7 @@ static rlm_cache_entry_t *cache_add(rlm_cache_t *inst, REQUEST *request,
 
                        found = pairfind(*from, da->attr, da->vendor, TAG_ANY);
                        if (!found) {
-                               RDEBUG("WARNING: \"%s\" not found, skipping",
+                               RDEBUGW("\"%s\" not found, skipping",
                                       map->src->name);
                                continue;
                        }
index 5b04022489b7154124434da3f414c63d92df656f..8e5313594ae8453c8fbf7a8762b49392a168bd41 100644 (file)
@@ -39,7 +39,7 @@ static rlm_rcode_t chap_authorize(void *instance, REQUEST *request)
        }
 
        if (pairfind(request->config_items, PW_AUTHTYPE, 0, TAG_ANY) != NULL) {
-               RDEBUG2("WARNING: Auth-Type already set.  Not setting to CHAP");
+               RDEBUG2W("Auth-Type already set.  Not setting to CHAP");
                return RLM_MODULE_NOOP;
        }
 
@@ -74,17 +74,17 @@ static rlm_rcode_t chap_authenticate(void *instance, REQUEST *request)
 
        chap = pairfind(request->packet->vps, PW_CHAP_PASSWORD, 0, TAG_ANY);
        if (!chap) {
-               RDEBUG("ERROR: You set 'Auth-Type = CHAP' for a request that does not contain a CHAP-Password attribute!");
+               RDEBUGE("You set 'Auth-Type = CHAP' for a request that does not contain a CHAP-Password attribute!");
                return RLM_MODULE_INVALID;
        }
 
        if (chap->length == 0) {
-               RDEBUG("ERROR: CHAP-Password is empty");
+               RDEBUGE("CHAP-Password is empty");
                return RLM_MODULE_INVALID;
        }
 
        if (chap->length != CHAP_VALUE_LENGTH + 1) {
-               RDEBUG("ERROR: CHAP-Password has invalid length");
+               RDEBUGE("CHAP-Password has invalid length");
                return RLM_MODULE_INVALID;
        }
 
index 207cfb8ec7782caec6e62dec9c76bd7f3519b34b..ad7d6a579200b6feb9352621ac84e7177f26b78b 100644 (file)
@@ -232,7 +232,7 @@ static rlm_rcode_t do_detail(void *instance, REQUEST *request, RADIUS_PACKET *pa
        if ((request->listener->type == RAD_LISTEN_DETAIL) &&
            (fnmatch(((listen_detail_t *)request->listener->data)->filename,
                     buffer, FNM_FILE_NAME | FNM_PERIOD ) == 0)) {
-               RDEBUG2("WARNING: Suppressing infinite loop.");
+               RDEBUG2W("Suppressing infinite loop.");
                return RLM_MODULE_NOOP;
        }
 #endif
index a3b8bf6641541f5452636517cad486b8070af283..5c0fb7f9a0f64509e36a25039e91edd5c33302d6 100644 (file)
@@ -64,7 +64,7 @@ static size_t dhcp_options_xlat(UNUSED void *instance, REQUEST *request,
        
        if ((fr_dhcp_decode_options(vp->vp_octets, vp->length, &head) < 0) ||
            (head == NULL)) {
-               RDEBUG("WARNING: DHCP option decoding failed");
+               RDEBUGW("DHCP option decoding failed");
                goto fail;
        }
        
index 72ac3c8e057ecf05839a1ebee4d0a912366f3f9c..01c21e3860523d15963bca8e38720bd0014f476a 100644 (file)
@@ -122,7 +122,7 @@ static int digest_fix(REQUEST *request)
                         *      The attribute type must be valid
                         */
                        if ((p[0] == 0) || (p[0] > 10)) {
-                               RDEBUG("ERROR: Received Digest-Attributes with invalid sub-attribute %d", p[0]);
+                               RDEBUGE("Received Digest-Attributes with invalid sub-attribute %d", p[0]);
                                return RLM_MODULE_INVALID;
                        }
 
@@ -132,7 +132,7 @@ static int digest_fix(REQUEST *request)
                         *      Too short.
                         */
                        if (attrlen < 3) {
-                               RDEBUG("ERROR: Received Digest-Attributes with short sub-attribute %d, of length %d", p[0], attrlen);
+                               RDEBUGE("Received Digest-Attributes with short sub-attribute %d, of length %d", p[0], attrlen);
                                return RLM_MODULE_INVALID;
                        }
 
@@ -140,7 +140,7 @@ static int digest_fix(REQUEST *request)
                         *      Too long.
                         */
                        if (attrlen > length) {
-                               RDEBUG("ERROR: Received Digest-Attributes with long sub-attribute %d, of length %d", p[0], attrlen);
+                               RDEBUGE("Received Digest-Attributes with long sub-attribute %d, of length %d", p[0], attrlen);
                                return RLM_MODULE_INVALID;
                        }
 
@@ -193,7 +193,7 @@ static rlm_rcode_t digest_authorize(void *instance, REQUEST *request)
 
 
        if (pairfind(request->config_items, PW_AUTHTYPE, 0, TAG_ANY)) {
-               RDEBUG2("WARNING: Auth-Type already set.  Not setting to DIGEST");
+               RDEBUG2W("Auth-Type already set.  Not setting to DIGEST");
                return RLM_MODULE_NOOP;
        }
 
@@ -247,7 +247,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
        vp = pairfind(request->packet->vps, PW_DIGEST_ATTRIBUTES, 0, TAG_ANY);
        if (vp == NULL) {
        error:
-               RDEBUG("ERROR: You set 'Auth-Type = Digest' for a request that does not contain any digest attributes!");
+               RDEBUGE("You set 'Auth-Type = Digest' for a request that does not contain any digest attributes!");
                return RLM_MODULE_INVALID;
        }
 
@@ -277,7 +277,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
         */
        nonce = pairfind(request->packet->vps, PW_DIGEST_NONCE, 0, TAG_ANY);
        if (!nonce) {
-               RDEBUG("ERROR: No Digest-Nonce: Cannot perform Digest authentication");
+               RDEBUGE("No Digest-Nonce: Cannot perform Digest authentication");
                return RLM_MODULE_INVALID;
        }
 
@@ -286,7 +286,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
         */
        vp = pairfind(request->packet->vps, PW_DIGEST_USER_NAME, 0, TAG_ANY);
        if (!vp) {
-               RDEBUG("ERROR: No Digest-User-Name: Cannot perform Digest authentication");
+               RDEBUGE("No Digest-User-Name: Cannot perform Digest authentication");
                return RLM_MODULE_INVALID;
        }
        memcpy(&a1[0], &vp->vp_octets[0], vp->length);
@@ -297,7 +297,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
 
        vp = pairfind(request->packet->vps, PW_DIGEST_REALM, 0, TAG_ANY);
        if (!vp) {
-               RDEBUG("ERROR: No Digest-Realm: Cannot perform Digest authentication");
+               RDEBUGE("No Digest-Realm: Cannot perform Digest authentication");
                return RLM_MODULE_INVALID;
        }
        memcpy(&a1[a1_len], &vp->vp_octets[0], vp->length);
@@ -356,7 +356,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
                 *      Tack on the Digest-Nonce. Length must be even
                 */
                if ((nonce->length & 1) != 0) {
-                       RDEBUG("ERROR: Received Digest-Nonce hex string with invalid length: Cannot perform Digest authentication");
+                       RDEBUGE("Received Digest-Nonce hex string with invalid length: Cannot perform Digest authentication");
                        return RLM_MODULE_INVALID;
                }
                memcpy(&a1[a1_len], &nonce->vp_octets[0], nonce->length);
@@ -367,7 +367,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
 
                vp = pairfind(request->packet->vps, PW_DIGEST_CNONCE, 0, TAG_ANY);
                if (!vp) {
-                       RDEBUG("ERROR: No Digest-CNonce: Cannot perform Digest authentication");
+                       RDEBUGE("No Digest-CNonce: Cannot perform Digest authentication");
                        return RLM_MODULE_INVALID;
                }
 
@@ -375,7 +375,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
                 *      Digest-CNonce length must be even
                 */
                if ((vp->length & 1) != 0) {
-                       RDEBUG("ERROR: Received Digest-CNonce hex string with invalid length: Cannot perform Digest authentication");
+                       RDEBUGE("Received Digest-CNonce hex string with invalid length: Cannot perform Digest authentication");
                        return RLM_MODULE_INVALID;
                }
                memcpy(&a1[a1_len], &vp->vp_octets[0], vp->length);
@@ -387,7 +387,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
                 *      We check for "MD5-sess" and "MD5".
                 *      Anything else is an error.
                 */
-               RDEBUG("ERROR: Unknown Digest-Algorithm \"%s\": Cannot perform Digest authentication", vp->vp_strvalue);
+               RDEBUGE("Unknown Digest-Algorithm \"%s\": Cannot perform Digest authentication", vp->vp_strvalue);
                return RLM_MODULE_INVALID;
        }
 
@@ -396,7 +396,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
         */
        vp = pairfind(request->packet->vps, PW_DIGEST_METHOD, 0, TAG_ANY);
        if (!vp) {
-               RDEBUG("ERROR: No Digest-Method: Cannot perform Digest authentication");
+               RDEBUGE("No Digest-Method: Cannot perform Digest authentication");
                return RLM_MODULE_INVALID;
        }
        memcpy(&a2[0], &vp->vp_octets[0], vp->length);
@@ -407,7 +407,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
 
        vp = pairfind(request->packet->vps, PW_DIGEST_URI, 0, TAG_ANY);
        if (!vp) {
-               RDEBUG("ERROR: No Digest-URI: Cannot perform Digest authentication");
+               RDEBUGE("No Digest-URI: Cannot perform Digest authentication");
                return RLM_MODULE_INVALID;
        }
        memcpy(&a2[a2_len], &vp->vp_octets[0], vp->length);
@@ -432,12 +432,12 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
                 */
                body = pairfind(request->packet->vps, PW_DIGEST_BODY_DIGEST, 0, TAG_ANY);
                if (!body) {
-                       RDEBUG("ERROR: No Digest-Body-Digest: Cannot perform Digest authentication");
+                       RDEBUGE("No Digest-Body-Digest: Cannot perform Digest authentication");
                        return RLM_MODULE_INVALID;
                }
 
                if ((a2_len + body->length) > sizeof(a2)) {
-                       RDEBUG("ERROR: Digest-Body-Digest is too long");
+                       RDEBUGE("Digest-Body-Digest is too long");
                        return RLM_MODULE_INVALID;
                }
 
@@ -446,7 +446,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
 
        } else if ((qop != NULL) &&
                   (strcasecmp(qop->vp_strvalue, "auth") != 0)) {
-               RDEBUG("ERROR: Unknown Digest-QOP \"%s\": Cannot perform Digest authentication", qop->vp_strvalue);
+               RDEBUGE("Unknown Digest-QOP \"%s\": Cannot perform Digest authentication", qop->vp_strvalue);
                return RLM_MODULE_INVALID;
        }
 
@@ -503,7 +503,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
 
                vp = pairfind(request->packet->vps, PW_DIGEST_NONCE_COUNT, 0, TAG_ANY);
                if (!vp) {
-                       RDEBUG("ERROR: No Digest-Nonce-Count: Cannot perform Digest authentication");
+                       RDEBUGE("No Digest-Nonce-Count: Cannot perform Digest authentication");
                        return RLM_MODULE_INVALID;
                }
                memcpy(&kd[kd_len], &vp->vp_octets[0], vp->length);
@@ -514,7 +514,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
 
                vp = pairfind(request->packet->vps, PW_DIGEST_CNONCE, 0, TAG_ANY);
                if (!vp) {
-                       RDEBUG("ERROR: No Digest-CNonce: Cannot perform Digest authentication");
+                       RDEBUGE("No Digest-CNonce: Cannot perform Digest authentication");
                        return RLM_MODULE_INVALID;
                }
                memcpy(&kd[kd_len], &vp->vp_octets[0], vp->length);
@@ -563,7 +563,7 @@ static rlm_rcode_t digest_authenticate(void *instance, REQUEST *request)
         */
        vp = pairfind(request->packet->vps, PW_DIGEST_RESPONSE, 0, TAG_ANY);
        if (!vp) {
-               RDEBUG("ERROR: No Digest-Response attribute in the request.  Cannot perform digest authentication");
+               RDEBUGE("No Digest-Response attribute in the request.  Cannot perform digest authentication");
                return RLM_MODULE_INVALID;
        }
 
index c00dd307ff7d0d1be66b3501ec70864796901755..09b7f516d06c8f0d2e10b0456739575795bcb407 100644 (file)
@@ -261,7 +261,7 @@ int eaptype_select(rlm_eap_t *inst, EAP_HANDLER *handler)
 
                if ((default_eap_type == PW_EAP_TNC) &&
                    !handler->request->parent) {
-                       RDEBUG2("ERROR: EAP-TNC must be run inside of a TLS method.");
+                       RDEBUG2E("EAP-TNC must be run inside of a TLS method.");
                        return EAP_INVALID;
                }
 
@@ -342,7 +342,7 @@ int eaptype_select(rlm_eap_t *inst, EAP_HANDLER *handler)
                         *      Prevent a firestorm if the client is confused.
                         */
                        if (handler->eap_type == eaptype->data[i]) {
-                               RDEBUG2("ERROR! Our request for %s was NAK'd with a request for %s.  Skipping the requested type.",
+                               RDEBUG2E("Our request for %s was NAK'd with a request for %s.  Skipping the requested type.",
                                       eaptype_name, eaptype_name);
                                continue;
                        }
@@ -1085,7 +1085,7 @@ EAP_HANDLER *eap_handler(rlm_eap_t *inst, eap_packet_t **eap_packet_p,
                         *      request vps so that autz's work
                         *      correctly
                        */
-                      RDEBUG2("WARNING NAS did not set User-Name.  Setting it locally from EAP Identity");
+                      RDEBUG2W("NAS did not set User-Name.  Setting it locally from EAP Identity");
                        vp = pairmake("User-Name", handler->identity, T_OP_EQ);
                        if (vp == NULL) {
                                RDEBUG("Out of memory");
index 9dcc5e4470ad108c43761f626f7c9df5e52e82e8..f7d8a9e07440c2ef9ac0a61ee31342f471cac1ca 100644 (file)
@@ -196,7 +196,7 @@ int eaptls_success(EAP_HANDLER *handler, int peap_flag)
                eaptls_gen_mppe_keys(&handler->request->reply->vps,
                                     tls_session->ssl, tls_session->prf_label);
        } else {
-               RDEBUG("WARNING: Not adding MPPE keys because there is no PRF label");
+               RDEBUGW("Not adding MPPE keys because there is no PRF label");
        }
 
        return 1;
index fb4a468202834bf5e040c6de7f10e7648cfe057f..b0314c7938226820894e99cada28cb5311847ec9 100644 (file)
@@ -237,15 +237,15 @@ done:
        free(check);
 
        if (do_warning) {
-               DEBUG("WARNING: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-               DEBUG("WARNING: !! EAP session with state 0x%02x%02x%02x%02x%02x%02x%02x%02x did not finish!  !!",
+               DEBUGW("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+               DEBUGW("!! EAP session with state 0x%02x%02x%02x%02x%02x%02x%02x%02x did not finish!  !!",
                      state[0], state[1],
                      state[2], state[3],
                      state[4], state[5],
                      state[6], state[7]);
 
-               DEBUG("WARNING: !! Please read http://wiki.freeradius.org/guide/Certificate_Compatibility     !!");
-               DEBUG("WARNING: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+               DEBUGW("!! Please read http://wiki.freeradius.org/guide/Certificate_Compatibility     !!");
+               DEBUGW("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
        }
 }
 
index 9bdb8bfaa4cc15970707c3fe3975b5e0801bd3de..55c77892a7ab4dd2772064b4ab05fd1f5812f49b 100644 (file)
@@ -98,7 +98,7 @@ static int eap_handler_cmp(const void *a, const void *b)
         *      EAP work.
         */
        if (fr_ipaddr_cmp(&one->src_ipaddr, &two->src_ipaddr) != 0) {
-               DEBUG("WARNING: EAP packets are arriving from two different upstream servers.  Has there been a proxy fail-over?");
+               DEBUGW("EAP packets are arriving from two different upstream servers.  Has there been a proxy fail-over?");
        }
 
        return 0;
@@ -286,7 +286,7 @@ static rlm_rcode_t eap_authenticate(void *instance, REQUEST *request)
        inst = (rlm_eap_t *) instance;
 
        if (!pairfind(request->packet->vps, PW_EAP_MESSAGE, 0, TAG_ANY)) {
-               RDEBUG("ERROR: You set 'Auth-Type = EAP' for a request that does not contain an EAP-Message attribute!");
+               RDEBUGE("You set 'Auth-Type = EAP' for a request that does not contain an EAP-Message attribute!");
                return RLM_MODULE_INVALID;
        }
 
@@ -549,7 +549,7 @@ static rlm_rcode_t eap_authorize(void *instance, REQUEST *request)
                }
                pairadd(&request->config_items, vp);
        } else {
-               RDEBUG2("WARNING: Auth-Type already set.  Not setting to EAP");
+               RDEBUG2W("Auth-Type already set.  Not setting to EAP");
        }
 
        if (status == EAP_OK) return RLM_MODULE_OK;
index 43330f6ba74f77359b37c89db9a30a235f6f87d7..daf6e9345e3fb3f59fcfe8f0fcaf407795389de3 100644 (file)
@@ -155,6 +155,7 @@ static int gtc_authenticate(void *type_data, EAP_HANDLER *handler)
        VALUE_PAIR *vp;
        EAP_DS *eap_ds = handler->eap_ds;
        rlm_eap_gtc_t *inst = (rlm_eap_gtc_t *) type_data;
+       REQUEST *request = handler->request;
 
        /*
         *      Get the Cleartext-Password for this user.
@@ -195,20 +196,20 @@ static int gtc_authenticate(void *type_data, EAP_HANDLER *handler)
                 */
                vp = pairfind(handler->request->config_items, PW_CLEARTEXT_PASSWORD, 0, TAG_ANY);
                if (!vp) {
-                       DEBUG2("  rlm_eap_gtc: ERROR: Cleartext-Password is required for authentication.");
+                       RDEBUG2E("Cleartext-Password is required for authentication.");
                        eap_ds->request->code = PW_EAP_FAILURE;
                        return 0;
                }
 
                if (eap_ds->response->type.length != vp->length) {
-                 DEBUG2("  rlm_eap_gtc: ERROR: Passwords are of different length. %u %u", (unsigned) eap_ds->response->type.length, (unsigned) vp->length);
+                       RDEBUG2E("Passwords are of different length. %u %u", (unsigned) eap_ds->response->type.length, (unsigned) vp->length);
                        eap_ds->request->code = PW_EAP_FAILURE;
                        return 0;
                }
 
                if (memcmp(eap_ds->response->type.data,
                           vp->vp_strvalue, vp->length) != 0) {
-                       DEBUG2("  rlm_eap_gtc: ERROR: Passwords are different");
+                       RDEBUG2E("Passwords are different");
                        eap_ds->request->code = PW_EAP_FAILURE;
                        return 0;
                }
@@ -258,8 +259,6 @@ static int gtc_authenticate(void *type_data, EAP_HANDLER *handler)
 
        }
 
-       DEBUG2("  rlm_eap_gtc: Everything is OK.");
-
        eap_ds->request->code = PW_EAP_SUCCESS;
 
        return 1;
index bc3deb4fba9cd699103b0803ff6f8c7fb626357b..4e1a9738a74d8fb2871ba388b2b8d1597506bd54 100644 (file)
@@ -127,7 +127,7 @@ int getusersfile(const char *filename, PAIR_LIST **pair_list, const char *compat
                                if ((vp->da->vendor!= 0) ||
                                                (vp->da->attr < 0x100)) {
                                        if (!compat_mode) {
-                                               DEBUG("[%s]:%d WARNING! Changing '%s =' to '%s =='\n\tfor comparing RADIUS attribute in check item list for user %s",
+                                               DEBUGW("[%s]:%d Changing '%s =' to '%s =='\n\tfor comparing RADIUS attribute in check item list for user %s",
                                                                filename, entry->lineno,
                                                                vp->da->name, vp->da->name,
                                                                entry->name);
index 712bbd813e899d9511b06c424e63a1f03318e7cc..ca3d471b33b0fbb3f291e1c391b5281b508acfe0 100644 (file)
@@ -113,7 +113,7 @@ static int diameter_verify(REQUEST *request,
                 *      of the packet, die.
                 */
                if (remaining < length) {
-                       RDEBUG2("ERROR! Diameter attribute overflows packet!");
+                       RDEBUG2E("Diameter attribute overflows packet!");
                        return 0;
                }
 
@@ -196,7 +196,7 @@ static VALUE_PAIR *diameter2vp(REQUEST *request, SSL *ssl,
                 *      Normal attributes cannot be.
                 */
                if ((attr > 255) && (vendor == 0)) {
-                       RDEBUG2("WARNING: Skipping Diameter attribute %u",
+                       RDEBUG2W("Skipping Diameter attribute %u",
                                attr);
                        goto next_attr;
                }
@@ -205,7 +205,7 @@ static VALUE_PAIR *diameter2vp(REQUEST *request, SSL *ssl,
                 * EAP-Message AVPs can be larger than 253 octets.
                 */
                if ((size > 253) && !((vendor == 0) && (attr == PW_EAP_MESSAGE))) {
-                       RDEBUG2("WARNING: diameter2vp skipping long attribute %u", attr);
+                       RDEBUG2W("diameter2vp skipping long attribute %u", attr);
                        goto next_attr;
                }
 
@@ -228,13 +228,13 @@ static VALUE_PAIR *diameter2vp(REQUEST *request, SSL *ssl,
                        decoded = rad_attr2vp(NULL, NULL, NULL,
                                              buffer, size + 2, &vp);
                        if (decoded < 0) {
-                               RDEBUG2("ERROR: diameter2vp failed decoding attr: %s",
+                               RDEBUG2E("diameter2vp failed decoding attr: %s",
                                        fr_strerror());
                                goto do_octets;
                        }
 
                        if ((size_t) decoded != size + 2) {
-                               RDEBUG2("ERROR: diameter2vp failed to entirely decode VSA");
+                               RDEBUG2E("diameter2vp failed to entirely decode VSA");
                                pairfree(&vp);
                                goto do_octets;
                        }
@@ -1105,7 +1105,7 @@ int eapttls_process(EAP_HANDLER *handler, tls_session_t *tls_session)
                                 *      as it's permitted to do EAP without
                                 *      user-name.
                                 */
-                               RDEBUG2("WARNING! No EAP-Identity found to start EAP conversation.");
+                               RDEBUG2W("No EAP-Identity found to start EAP conversation.");
                        }
                } /* else there WAS a t->username */
 
index c843a540430764bbf5abe12c8584564dfba390cc..bcdd693f3fa27094d245d6380c9ef290eda6fe49 100644 (file)
@@ -310,7 +310,7 @@ static rlm_rcode_t exec_dispatch(void *instance, REQUEST *request)
        output_pairs = decode_string(request, inst->output);
 
        if (!input_pairs) {
-               RDEBUG2("WARNING: Possible parse error in %s",
+               RDEBUG2W("Possible parse error in %s",
                        inst->input);
                return RLM_MODULE_NOOP;
        }
@@ -320,7 +320,7 @@ static rlm_rcode_t exec_dispatch(void *instance, REQUEST *request)
         *      list is empty.
         */
        if (!*input_pairs) {
-               RDEBUG2("WARNING! Input pairs are empty.  No attributes will be passed to the script");
+               RDEBUG2W("Input pairs are empty.  No attributes will be passed to the script");
        }
 
        /*
index ac938bf6ebb02e31aa0b9ccf12026316e1b0eeb7..66b9196398826ac4fb107b7b6f2898defee3184b 100644 (file)
@@ -182,7 +182,7 @@ static int getusersfile(const char *filename, fr_hash_table_t **pht,
                                if ((vp->da->vendor != 0) ||
                                                (vp->da->attr < 0x100)) {
                                        if (!compat_mode) {
-                                               DEBUG("[%s]:%d WARNING! Changing '%s =' to '%s =='\n\tfor comparing RADIUS attribute in check item list for user %s",
+                                               DEBUGW("[%s]:%d Changing '%s =' to '%s =='\n\tfor comparing RADIUS attribute in check item list for user %s",
                                                                filename, entry->lineno,
                                                                vp->da->name, vp->da->name,
                                                                entry->name);
index 5eef7a766e4987bd42b02c37cc4884b8609bffca..41e59673af382bc93bb18c08f15a7cb0d2db8461 100644 (file)
@@ -1798,7 +1798,7 @@ static void do_check_reply(ldap_instance *inst, REQUEST *request)
                    !pairfind(request->config_items, PW_USER_PASSWORD, 0, TAG_ANY) &&
                    !pairfind(request->config_items, PW_PASSWORD_WITH_HEADER, 0, TAG_ANY) &&
                    !pairfind(request->config_items, PW_CRYPT_PASSWORD, 0, TAG_ANY)) {
-                       RDEBUG("WARNING: No \"known good\" password "
+                       RDEBUGW("No \"known good\" password "
                               "was found in LDAP.  Are you sure that "
                                "the user is configured correctly?");
                }
index 32e535d0a3add1807f7b8eba8caa2ec1c01758b6..18cd5241d5dd05729c3e329a3446bfa7455ace5f 100644 (file)
@@ -264,7 +264,7 @@ static size_t mschap_xlat(void *instance, REQUEST *request,
                        if (response_name &&
                            ((user_name->length != response_name->length) ||
                             (strncasecmp(user_name->vp_strvalue, response_name->vp_strvalue, user_name->length) != 0))) {
-                               RDEBUG("WARNING: User-Name (%s) is not the same as MS-CHAP Name (%s) from EAP-MSCHAPv2", user_name->vp_strvalue, response_name->vp_strvalue);
+                               RDEBUGW("User-Name (%s) is not the same as MS-CHAP Name (%s) from EAP-MSCHAPv2", user_name->vp_strvalue, response_name->vp_strvalue);
                        }
 
                        /*
@@ -1290,7 +1290,7 @@ static rlm_rcode_t mschap_authorize(void * instance, REQUEST *request)
        }
 
        if (pairfind(request->config_items, PW_AUTH_TYPE, 0, TAG_ANY)) {
-               RDEBUG2("WARNING: Auth-Type already set.  Not setting to MS-CHAP");
+               RDEBUG2W("Auth-Type already set.  Not setting to MS-CHAP");
                return RLM_MODULE_NOOP;
        }
 
@@ -1589,7 +1589,7 @@ static rlm_rcode_t mschap_authenticate(void * instance, REQUEST *request)
 
        challenge = pairfind(request->packet->vps, PW_MSCHAP_CHALLENGE, VENDORPEC_MICROSOFT, TAG_ANY);
        if (!challenge) {
-               RDEBUG("ERROR: You set 'Auth-Type = MS-CHAP' for a request that does not contain any MS-CHAP attributes!");
+               RDEBUGE("You set 'Auth-Type = MS-CHAP' for a request that does not contain any MS-CHAP attributes!");
                return RLM_MODULE_REJECT;
        }
 
@@ -1709,7 +1709,7 @@ static rlm_rcode_t mschap_authenticate(void * instance, REQUEST *request)
                if (response_name &&
                    ((username->length != response_name->length) ||
                     (strncasecmp(username->vp_strvalue, response_name->vp_strvalue, username->length) != 0))) {
-                       RDEBUG("ERROR: User-Name (%s) is not the same as MS-CHAP Name (%s) from EAP-MSCHAPv2", username->vp_strvalue, response_name->vp_strvalue);
+                       RDEBUGE("User-Name (%s) is not the same as MS-CHAP Name (%s) from EAP-MSCHAPv2", username->vp_strvalue, response_name->vp_strvalue);
                        return RLM_MODULE_REJECT;
                }
 
@@ -1810,7 +1810,7 @@ static rlm_rcode_t mschap_authenticate(void * instance, REQUEST *request)
                chap = 2;
 
        } else {                /* Neither CHAPv1 or CHAPv2 response: die */
-               RDEBUG("ERROR: You set 'Auth-Type = MS-CHAP' for a request that does not contain any MS-CHAP attributes!");
+               RDEBUGE("You set 'Auth-Type = MS-CHAP' for a request that does not contain any MS-CHAP attributes!");
                return RLM_MODULE_INVALID;
        }
 
index cc259254b51b133d8c5cb1eda9f75df128ce50df..3b4df2e804373339b5a1073e832baf68b5396304 100644 (file)
@@ -281,7 +281,7 @@ static rlm_rcode_t od_authenticate(UNUSED void *instance, REQUEST *request)
         *      a User-Name attribute.
         */
        if (!request->username) {
-               RDEBUG("ERROR: You set 'Auth-Type = OpenDirectory' for a request that does not contain a User-Name attribute!");
+               RDEBUGE("You set 'Auth-Type = OpenDirectory' for a request that does not contain a User-Name attribute!");
                return RLM_MODULE_INVALID;
        }
 
@@ -290,7 +290,7 @@ static rlm_rcode_t od_authenticate(UNUSED void *instance, REQUEST *request)
         */
        if (!request->password ||
                (request->password->da->attr != PW_PASSWORD)) {
-               RDEBUG("ERROR: You set 'Auth-Type = OpenDirectory' for a request that does not contain a User-Password attribute!");
+               RDEBUGE("You set 'Auth-Type = OpenDirectory' for a request that does not contain a User-Password attribute!");
                return RLM_MODULE_INVALID;
        }
        
index 6852c662984cd68a00187063fab3d74dd3307351..4fd0fc67bf60a950273575ca23421beeb55fbdf1 100644 (file)
@@ -410,7 +410,8 @@ static rlm_rcode_t pap_authorize(void *instance, REQUEST *request)
                        return RLM_MODULE_NOOP;
                }
 
-               RDEBUG("WARNING! No \"known good\" password found for the user.  Authentication may fail because of this.");
+               RDEBUGW("No \"known good\" password found for the user.  Not setting Auth-Type.");
+               RDEBUGW("Configure a \"known good\" password to get an Access-Accept.");
                return RLM_MODULE_NOOP;
        }
 
@@ -418,7 +419,7 @@ static rlm_rcode_t pap_authorize(void *instance, REQUEST *request)
         *      Don't touch existing Auth-Types.
         */
        if (auth_type) {
-               RDEBUG2("WARNING: Auth-Type already set.  Not setting to PAP");
+               RDEBUG2W("Auth-Type already set.  Not setting to PAP");
                return RLM_MODULE_NOOP;
        }
 
@@ -465,7 +466,7 @@ static rlm_rcode_t pap_authenticate(void *instance, REQUEST *request)
 
        if (!request->password ||
            (request->password->da->attr != PW_USER_PASSWORD)) {
-               RDEBUG("ERROR: You set 'Auth-Type = PAP' for a request that does not contain a User-Password attribute!");
+               RDEBUGE("You set 'Auth-Type = PAP' for a request that does not contain a User-Password attribute!");
                return RLM_MODULE_INVALID;
        }
 
index 999b5ce1e029c5987a745650a7ec8abe8160ab90..4bf47bcff3a2e63a41cfb1da14addce77762f2aa 100644 (file)
@@ -336,8 +336,8 @@ static void rad_mangle(rlm_preprocess_t *data, REQUEST *request)
        }
 
        if (num_proxy_state > 10) {
-               DEBUG("WARNING: There are more than 10 Proxy-State attributes in the request.");
-               DEBUG("WARNING: You have likely configured an infinite proxy loop.");
+               RDEBUGW("There are more than 10 Proxy-State attributes in the request.");
+               RDEBUGW("You have likely configured an infinite proxy loop.");
        }
 }
 
index c72bbd0cd99161750a09e67a9eb6f328c5b28a6a..2bc9fef9d0550c3cd2f21ce4a6231da66e716872 100644 (file)
@@ -406,7 +406,7 @@ static rlm_rcode_t radutmp_accounting(void *instance, REQUEST *request)
         */
        if (!port_seen) {
                DEBUG2("  rlm_radutmp: No NAS-Port seen.  Cannot do anything.");
-               DEBUG2("  rlm_radumtp: WARNING: checkrad will probably not work!");
+               DEBUG2W("checkrad will probably not work!");
                return RLM_MODULE_NOOP;
        }
 
index 4057b84cfa3a3fa35360d40ee9b7faaa66f7df21..d4e1426d87713700a27d5a7e7fc048ac64fcf7c3 100644 (file)
@@ -967,7 +967,7 @@ static rlm_rcode_t radutmp_accounting(void *instance, REQUEST *request)
         */
        if (!port_seen) {
                DEBUG2("  rlm_radutmp: No NAS-Port in the packet.  Cannot do anything.");
-               DEBUG2("  rlm_radumtp: WARNING: checkrad will probably not work!");
+               DEBUG2W("checkrad will probably not work!");
                return RLM_MODULE_NOOP;
        }
 
index fe3946cc5392279d9c8b6727447faea77311e21d..575d83028994006704096ace3618f4b6b8cce360 100644 (file)
@@ -76,7 +76,7 @@ static int replicate_packet(void *instance, REQUEST *request,
 
                realm = realm_find2(vp->vp_strvalue);
                if (!realm) {
-                       RDEBUG2("ERROR: Cannot Replicate to unknown realm %s", realm);
+                       RDEBUG2E("Cannot Replicate to unknown realm %s", realm);
                        continue;
                }
                
@@ -85,7 +85,7 @@ static int replicate_packet(void *instance, REQUEST *request,
                 */
                switch (request->packet->code) {
                default:
-                       RDEBUG2("ERROR: Cannot replicate unknown packet code %d",
+                       RDEBUG2E("Cannot replicate unknown packet code %d",
                                request->packet->code);
                        cleanup(packet);
                        return RLM_MODULE_FAIL;
@@ -110,13 +110,13 @@ static int replicate_packet(void *instance, REQUEST *request,
                }
                
                if (!pool) {
-                       RDEBUG2(" WARNING: Cancelling replication to Realm %s, as the realm is local.", realm->name);
+                       RDEBUG2W("Cancelling replication to Realm %s, as the realm is local.", realm->name);
                        continue;
                }
                
                home = home_server_ldb(realm->name, pool, request);
                if (!home) {
-                       RDEBUG2("ERROR: Failed to find live home server for realm %s",
+                       RDEBUG2E("Failed to find live home server for realm %s",
                                realm->name);
                        continue;
                }
@@ -134,14 +134,14 @@ static int replicate_packet(void *instance, REQUEST *request,
 
                        packet->sockfd = fr_socket(&home->src_ipaddr, 0);
                        if (packet->sockfd < 0) {
-                               RDEBUG("ERROR: Failed opening socket: %s", fr_strerror());
+                               RDEBUGE("Failed opening socket: %s", fr_strerror());
                                rcode = RLM_MODULE_FAIL;
                                goto done;
                        }
                        
                        vps = radius_list(request, list);
                        if (!vps) {
-                               RDEBUG("WARNING: List '%s' doesn't exist for "
+                               RDEBUGW("List '%s' doesn't exist for "
                                       "this packet", fr_int2str(pair_lists,
                                       list, "¿unknown?"));
                                rcode = RLM_MODULE_INVALID;
@@ -155,7 +155,7 @@ static int replicate_packet(void *instance, REQUEST *request,
                        if (*vps) {
                                packet->vps = paircopy(*vps);
                                if (!packet->vps) {
-                                       RDEBUG("ERROR: Out of memory!");
+                                       RDEBUGE("Out of memory!");
                                        rcode = RLM_MODULE_FAIL;
                                        goto done;
                                }
@@ -203,7 +203,7 @@ static int replicate_packet(void *instance, REQUEST *request,
                RDEBUG("Replicating list '%s' to Realm '%s'",
                       fr_int2str(pair_lists, list, "¿unknown?"),realm->name);
                if (rad_send(packet, NULL, home->secret) < 0) {
-                       RDEBUG("ERROR: Failed replicating packet: %s",
+                       RDEBUGE("Failed replicating packet: %s",
                               fr_strerror());
                        rcode = RLM_MODULE_FAIL;
                        goto done;
index 67bd11ae45d2bfb0d20fc7b0aa9179cf2148b0a3..5a7d3d4669aba975c65a7e8c1ccee377c21f98f0 100644 (file)
@@ -992,7 +992,7 @@ static int rest_decode_post(rlm_rest_t *instance,
                
                request_name = radius_request_name(&attribute, REQUEST_CURRENT);
                if (request_name == REQUEST_UNKNOWN) {
-                       RDEBUG("WARNING: Invalid request qualifier, skipping");
+                       RDEBUGW("Invalid request qualifier, skipping");
 
                        curl_free(name);
 
@@ -1000,7 +1000,7 @@ static int rest_decode_post(rlm_rest_t *instance,
                }
 
                if (!radius_request(&reference, request_name)) {
-                       RDEBUG("WARNING: Attribute name refers to outer request"
+                       RDEBUGW("Attribute name refers to outer request"
                               " but not in a tunnel, skipping");
 
                        curl_free(name);
@@ -1010,7 +1010,7 @@ static int rest_decode_post(rlm_rest_t *instance,
 
                list_name = radius_list_name(&attribute, PAIR_LIST_REPLY);
                if (list_name == PAIR_LIST_UNKNOWN) {
-                       RDEBUG("WARNING: Invalid list qualifier, skipping");
+                       RDEBUGW("Invalid list qualifier, skipping");
 
                        curl_free(name);
 
@@ -1019,7 +1019,7 @@ static int rest_decode_post(rlm_rest_t *instance,
 
                da = dict_attrbyname(attribute);
                if (!da) {
-                       RDEBUG("WARNING: Attribute \"%s\" unknown, skipping",
+                       RDEBUGW("Attribute \"%s\" unknown, skipping",
                               attribute);
 
                        curl_free(name);
@@ -1303,13 +1303,13 @@ static VALUE_PAIR *json_pairmake(rlm_rest_t *instance,
                
                request_name = radius_request_name(&attribute, REQUEST_CURRENT);
                if (request_name == REQUEST_UNKNOWN) {
-                       RDEBUG("WARNING: Request qualifier unknown, skipping");
+                       RDEBUGW("Request qualifier unknown, skipping");
 
                        continue;
                }
 
                if (!radius_request(&reference, request_name)) {
-                       RDEBUG("WARNING: Attribute name refers to outer request"
+                       RDEBUGW("Attribute name refers to outer request"
                               " but not in a tunnel, skipping");
 
                        continue;
@@ -1317,14 +1317,14 @@ static VALUE_PAIR *json_pairmake(rlm_rest_t *instance,
 
                list_name = radius_list_name(&attribute, PAIR_LIST_REPLY);
                if (list_name == PAIR_LIST_UNKNOWN) {
-                       RDEBUG("WARNING: Invalid list qualifier, skipping");
+                       RDEBUGW("Invalid list qualifier, skipping");
 
                        continue;
                }
 
                da = dict_attrbyname(attribute);
                if (!da) {
-                       RDEBUG("WARNING: Attribute \"%s\" unknown, skipping",
+                       RDEBUGW("Attribute \"%s\" unknown, skipping",
                               attribute);
 
                        continue;
index 325db01e9e841a357e7dedca09db169027b2abf3..25f61930e83a5e493f2e5b099718b09a5a8796d7 100644 (file)
@@ -296,7 +296,7 @@ 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}'");
+                               DEBUG2W("Please replace '%%k' with '${key}'");
                                strlcpy(q, data->key_name, freespace);
                                q += strlen(q);
                                break;
index fee6cf46a67494bcabc55aa48d39de00a49b6253..82fd59abde1a467e390bb90cc0ee3d53bcb86c3c 100644 (file)
@@ -268,8 +268,8 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
        mn_nai = pairfind(request->packet->vps, 1900, 0, TAG_ANY);
        if (!mn_nai) mn_nai = pairfind(request->reply->vps, 1900, 0, TAG_ANY);
        if (!mn_nai) {
-               RDEBUG("WARNING: WiMAX-MN-NAI was not found in the request or in the reply.");
-               RDEBUG("WARNING: We cannot calculate MN-HA keys.");
+               RDEBUGW("WiMAX-MN-NAI was not found in the request or in the reply.");
+               RDEBUGW("We cannot calculate MN-HA keys.");
        }
 
        /*
@@ -278,8 +278,8 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
        vp = NULL;
        if (mn_nai) vp = pairfind(request->reply->vps, 23, VENDORPEC_WIMAX, TAG_ANY);
        if (!vp) {
-               RDEBUG("WARNING: WiMAX-IP-Technology not found in reply.");
-               RDEBUG("WARNING: Not calculating MN-HA keys");
+               RDEBUGW("WiMAX-IP-Technology not found in reply.");
+               RDEBUGW("Not calculating MN-HA keys");
        }
 
        if (vp) switch (vp->vp_integer) {
@@ -289,7 +289,7 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
                 */
                ip = pairfind(request->reply->vps, 6, VENDORPEC_WIMAX, TAG_ANY);
                if (!ip) {
-                       RDEBUG("WARNING: WiMAX-hHA-IP-MIP4 not found.  Cannot calculate MN-HA-PMIP4 key");
+                       RDEBUGW("WiMAX-hHA-IP-MIP4 not found.  Cannot calculate MN-HA-PMIP4 key");
                        break;
                }
 
@@ -313,7 +313,7 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
                                               10, VENDORPEC_WIMAX);
                }
                if (!vp) {
-                       RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP4-Key");
+                       RDEBUGW("Failed creating WiMAX-MN-hHA-MIP4-Key");
                        break;
                }
                memcpy(vp->vp_octets, &mip_rk_1[0], rk1_len);
@@ -328,7 +328,7 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
                                               11, VENDORPEC_WIMAX);
                }
                if (!vp) {
-                       RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP4-SPI");
+                       RDEBUGW("Failed creating WiMAX-MN-hHA-MIP4-SPI");
                        break;
                }
                vp->vp_integer = mip_spi + 1;
@@ -340,7 +340,7 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
                 */
                ip = pairfind(request->reply->vps, 6, VENDORPEC_WIMAX, TAG_ANY);
                if (!ip) {
-                       RDEBUG("WARNING: WiMAX-hHA-IP-MIP4 not found.  Cannot calculate MN-HA-CMIP4 key");
+                       RDEBUGW("WiMAX-hHA-IP-MIP4 not found.  Cannot calculate MN-HA-CMIP4 key");
                        break;
                }
 
@@ -364,7 +364,7 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
                                               10, VENDORPEC_WIMAX);
                }
                if (!vp) {
-                       RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP4-Key");
+                       RDEBUGW("Failed creating WiMAX-MN-hHA-MIP4-Key");
                        break;
                }
                memcpy(vp->vp_octets, &mip_rk_1[0], rk1_len);
@@ -379,7 +379,7 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
                                               11, VENDORPEC_WIMAX);
                }
                if (!vp) {
-                       RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP4-SPI");
+                       RDEBUGW("Failed creating WiMAX-MN-hHA-MIP4-SPI");
                        break;
                }
                vp->vp_integer = mip_spi;
@@ -391,7 +391,7 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
                 */
                ip = pairfind(request->reply->vps, 7, VENDORPEC_WIMAX, TAG_ANY);
                if (!ip) {
-                       RDEBUG("WARNING: WiMAX-hHA-IP-MIP6 not found.  Cannot calculate MN-HA-CMIP6 key");
+                       RDEBUGW("WiMAX-hHA-IP-MIP6 not found.  Cannot calculate MN-HA-CMIP6 key");
                        break;
                }
 
@@ -415,7 +415,7 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
                                               12, VENDORPEC_WIMAX);
                }
                if (!vp) {
-                       RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP6-Key");
+                       RDEBUGW("Failed creating WiMAX-MN-hHA-MIP6-Key");
                        break;
                }
                memcpy(vp->vp_octets, &mip_rk_1[0], rk1_len);
@@ -430,7 +430,7 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
                                               13, VENDORPEC_WIMAX);
                }
                if (!vp) {
-                       RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP6-SPI");
+                       RDEBUGW("Failed creating WiMAX-MN-hHA-MIP6-SPI");
                        break;
                }
                vp->vp_integer = mip_spi + 2;
@@ -468,7 +468,7 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
                                               61, VENDORPEC_WIMAX);
                }
                if (!vp) {
-                       RDEBUG("WARNING: Failed creating WiMAX-FA-RK-SPI");
+                       RDEBUGW("Failed creating WiMAX-FA-RK-SPI");
                } else {
                        vp->vp_integer = mip_spi;
                }
@@ -483,14 +483,14 @@ static rlm_rcode_t wimax_postauth(void *instance, REQUEST *request)
        if (vp) {
                RDEBUG("Client requested MN-HA key: Should use SPI to look up key from storage.");
                if (!mn_nai) {
-                       RDEBUG("WARNING: MN-NAI was not found!");
+                       RDEBUGW("MN-NAI was not found!");
                }
 
                /*
                 *      WiMAX-RRQ-HA-IP
                 */
                if (!pairfind(request->packet->vps, 18, VENDORPEC_WIMAX, TAG_ANY)) {
-                       RDEBUG("WARNING: HA-IP was not found!");
+                       RDEBUGW("HA-IP was not found!");
                }