From: Alan T. DeKok Date: Mon, 18 Feb 2013 16:17:07 +0000 (-0500) Subject: Remove L_CONS X-Git-Tag: release_3_0_0_beta1~1053 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f37440e79263e5e6c8e5b3e04261b1c45670d2a7;p=thirdparty%2Ffreeradius-server.git Remove L_CONS --- diff --git a/src/include/radiusd.h b/src/include/radiusd.h index a5bd5b84f37..b9196d73327 100644 --- a/src/include/radiusd.h +++ b/src/include/radiusd.h @@ -469,7 +469,6 @@ typedef struct main_config_t { #define L_ERR 4 #define L_PROXY 5 #define L_ACCT 6 -#define L_CONS 128 /* for paircompare_register */ typedef int (*RAD_COMPARE_FUNC)(void *instance, REQUEST *,VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR **); diff --git a/src/main/conffile.c b/src/main/conffile.c index da1a4c99355..06e3e256ed9 100644 --- a/src/main/conffile.c +++ b/src/main/conffile.c @@ -1580,7 +1580,7 @@ static int cf_section_read(const char *filename, int *lineno, FILE *fp, } if ((stat_buf.st_mode & S_IWOTH) != 0) { - radlog(L_ERR|L_CONS, "%s[%d]: Directory %s is globally writable. Refusing to start due to insecure configuration.", + radlog(L_ERR, "%s[%d]: Directory %s is globally writable. Refusing to start due to insecure configuration.", filename, *lineno, value); return -1; } @@ -1893,7 +1893,7 @@ int cf_file_include(const char *filename, CONF_SECTION *cs) fp = fopen(filename, "r"); if (!fp) { - radlog(L_ERR|L_CONS, "Unable to open file \"%s\": %s", + radlog(L_ERR, "Unable to open file \"%s\": %s", filename, strerror(errno)); return -1; } @@ -1902,7 +1902,7 @@ int cf_file_include(const char *filename, CONF_SECTION *cs) #ifdef S_IWOTH if ((statbuf.st_mode & S_IWOTH) != 0) { fclose(fp); - radlog(L_ERR|L_CONS, "Configuration file %s is globally writable. Refusing to start due to insecure configuration.", + radlog(L_ERR, "Configuration file %s is globally writable. Refusing to start due to insecure configuration.", filename); return -1; } @@ -1911,7 +1911,7 @@ int cf_file_include(const char *filename, CONF_SECTION *cs) #ifdef S_IROTH if (0 && (statbuf.st_mode & S_IROTH) != 0) { fclose(fp); - radlog(L_ERR|L_CONS, "Configuration file %s is globally readable. Refusing to start due to insecure configuration.", + radlog(L_ERR, "Configuration file %s is globally readable. Refusing to start due to insecure configuration.", filename); return -1; } @@ -1934,7 +1934,7 @@ int cf_file_include(const char *filename, CONF_SECTION *cs) if (cf_data_add_internal(cs, filename, mtime, free, PW_TYPE_FILENAME) < 0) { fclose(fp); - radlog(L_ERR|L_CONS, "Internal error opening file \"%s\"", + radlog(L_ERR, "Internal error opening file \"%s\"", filename); return -1; } @@ -1942,7 +1942,7 @@ int cf_file_include(const char *filename, CONF_SECTION *cs) cd = cf_data_find_internal(cs, filename, PW_TYPE_FILENAME); if (!cd) { fclose(fp); - radlog(L_ERR|L_CONS, "Internal error opening file \"%s\"", + radlog(L_ERR, "Internal error opening file \"%s\"", filename); return -1; } diff --git a/src/main/exec.c b/src/main/exec.c index 86ffa8f49eb..9b1279bce5f 100644 --- a/src/main/exec.c +++ b/src/main/exec.c @@ -110,7 +110,7 @@ pid_t radius_start_program(const char *cmd, REQUEST *request, char mycmd[1024]; if (strlen(cmd) > (sizeof(mycmd) - 1)) { - radlog(L_ERR|L_CONS, "Command line is too long"); + radlog(L_ERR, "Command line is too long"); return -1; } @@ -118,7 +118,7 @@ pid_t radius_start_program(const char *cmd, REQUEST *request, * Check for bad escapes. */ if (cmd[strlen(cmd) - 1] == '\\') { - radlog(L_ERR|L_CONS, "Command line has final backslash, without a following character"); + radlog(L_ERR, "Command line has final backslash, without a following character"); return -1; } @@ -159,7 +159,7 @@ pid_t radius_start_program(const char *cmd, REQUEST *request, case '\'': length = rad_copy_string(to, from); if (length < 0) { - radlog(L_ERR|L_CONS, "Invalid string passed as argument for external program"); + radlog(L_ERR, "Invalid string passed as argument for external program"); return -1; } from += length; @@ -172,7 +172,7 @@ pid_t radius_start_program(const char *cmd, REQUEST *request, length = rad_copy_variable(to, from); if (length < 0) { - radlog(L_ERR|L_CONS, "Invalid variable expansion passed as argument for external program"); + radlog(L_ERR, "Invalid variable expansion passed as argument for external program"); return -1; } from += length; @@ -248,14 +248,14 @@ pid_t radius_start_program(const char *cmd, REQUEST *request, if (exec_wait) { if (input_fd) { if (pipe(to_child) != 0) { - radlog(L_ERR|L_CONS, "Couldn't open pipe to child: %s", + radlog(L_ERR, "Couldn't open pipe to child: %s", strerror(errno)); return -1; } } if (output_fd) { if (pipe(from_child) != 0) { - radlog(L_ERR|L_CONS, "Couldn't open pipe from child: %s", + radlog(L_ERR, "Couldn't open pipe from child: %s", strerror(errno)); /* safe because these either need closing or are == -1 */ close(to_child[0]); @@ -330,7 +330,7 @@ pid_t radius_start_program(const char *cmd, REQUEST *request, */ devnull = open("/dev/null", O_RDWR); if (devnull < 0) { - radlog(L_ERR|L_CONS, "Failed opening /dev/null: %s\n", + radlog(L_ERR, "Failed opening /dev/null: %s\n", strerror(errno)); exit(1); } @@ -397,7 +397,7 @@ pid_t radius_start_program(const char *cmd, REQUEST *request, * Parent process. */ if (pid < 0) { - radlog(L_ERR|L_CONS, "Couldn't fork %s: %s", + radlog(L_ERR, "Couldn't fork %s: %s", argv[0], strerror(errno)); if (exec_wait) { /* safe because these either need closing or are == -1 */ @@ -736,7 +736,7 @@ int radius_exec_program(const char *cmd, REQUEST *request, } } - radlog(L_ERR|L_CONS, "Exec-Program: Abnormal child exit: %s", + radlog(L_ERR, "Exec-Program: Abnormal child exit: %s", strerror(errno)); #endif /* __MINGW32__ */ diff --git a/src/main/files.c b/src/main/files.c index e6f75b5233d..e707a51a197 100644 --- a/src/main/files.c +++ b/src/main/files.c @@ -83,7 +83,7 @@ int pairlist_read(const char *file, PAIR_LIST **list, int complain) if ((fp = fopen(file, "r")) == NULL) { if (!complain) return -1; - radlog(L_CONS|L_ERR, "Couldn't open %s for reading: %s", + radlog(L_ERR, "Couldn't open %s for reading: %s", file, strerror(errno)); return -1; } @@ -118,7 +118,7 @@ parse_again: */ if (isspace((int) buffer[0])) { if (parsecode != T_EOL) { - radlog(L_ERR|L_CONS, + radlog(L_ERR, "%s[%d]: Unexpected trailing comma for entry %s", file, lineno, entry); fclose(fp); @@ -167,7 +167,7 @@ parse_again: if (pairlist_read(newfile, &t, 0) != 0) { pairlist_free(&pl); - radlog(L_ERR|L_CONS, + radlog(L_ERR, "%s[%d]: Could not open included file %s: %s", file, lineno, newfile, strerror(errno)); fclose(fp); @@ -195,13 +195,13 @@ parse_again: parsecode = userparse(ptr, &check_tmp); if (parsecode == T_OP_INVALID) { pairlist_free(&pl); - radlog(L_ERR|L_CONS, + radlog(L_ERR, "%s[%d]: Parse error (check) for entry %s: %s", file, lineno, entry, fr_strerror()); fclose(fp); return -1; } else if (parsecode == T_COMMA) { - radlog(L_ERR|L_CONS, + radlog(L_ERR, "%s[%d]: Unexpected trailing comma in check item list for entry %s", file, lineno, entry); fclose(fp); @@ -213,7 +213,7 @@ parse_again: else { if(*buffer == ' ' || *buffer == '\t') { if (parsecode != T_COMMA) { - radlog(L_ERR|L_CONS, + radlog(L_ERR, "%s[%d]: Syntax error: Previous line is missing a trailing comma for entry %s", file, lineno, entry); fclose(fp); @@ -227,7 +227,7 @@ parse_again: /* valid tokens are 1 or greater */ if (parsecode < 1) { pairlist_free(&pl); - radlog(L_ERR|L_CONS, + radlog(L_ERR, "%s[%d]: Parse error (reply) for entry %s: %s", file, lineno, entry, fr_strerror()); fclose(fp); diff --git a/src/main/log.c b/src/main/log.c index f3a14c2ce8f..64e9e6fc481 100644 --- a/src/main/log.c +++ b/src/main/log.c @@ -125,7 +125,7 @@ int vradlog(int lvl, const char *fmt, va_list ap) len = strlen(buffer); len += strlcpy(buffer + len, - fr_int2str(levels, (lvl & ~L_CONS), ": "), + fr_int2str(levels, lvl, ": "), sizeof(buffer) - len); } @@ -161,7 +161,7 @@ int vradlog(int lvl, const char *fmt, va_list ap) #ifdef HAVE_SYSLOG_H case RADLOG_SYSLOG: - switch(lvl & ~L_CONS) { + switch(lvl) { case L_DBG: lvl = LOG_DEBUG; break; @@ -334,7 +334,7 @@ void radlog_request(int lvl, int priority, REQUEST *request, const char *msg, .. } len += strlcpy(buffer + len, - fr_int2str(levels, (lvl & ~L_CONS), ": "), + fr_int2str(levels, lvl, ": "), sizeof(buffer) - len); if (len >= sizeof(buffer)) goto finish; diff --git a/src/main/modcall.c b/src/main/modcall.c index ca080fb04b9..6ad3bcfadfa 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -2429,6 +2429,9 @@ 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); diff --git a/src/main/radiusd.c b/src/main/radiusd.c index 58eec256b47..b376309c1ec 100644 --- a/src/main/radiusd.c +++ b/src/main/radiusd.c @@ -317,7 +317,7 @@ int main(int argc, char *argv[]) devnull = open("/dev/null", O_RDWR); if (devnull < 0) { - radlog(L_ERR|L_CONS, "Failed opening /dev/null: %s\n", + radlog(L_ERR, "Failed opening /dev/null: %s\n", strerror(errno)); exit(1); } @@ -416,7 +416,7 @@ int main(int argc, char *argv[]) fprintf(fp, "%d\n", (int) radius_pid); fclose(fp); } else { - radlog(L_ERR|L_CONS, "Failed creating PID file %s: %s\n", + radlog(L_ERR, "Failed creating PID file %s: %s\n", mainconfig.pid_file, strerror(errno)); exit(1); } diff --git a/src/main/realms.c b/src/main/realms.c index fee9ab0f53d..651d2555129 100644 --- a/src/main/realms.c +++ b/src/main/realms.c @@ -2108,7 +2108,7 @@ void home_server_update_request(home_server *home, REQUEST *request) */ if (!request->proxy) { if ((request->proxy = rad_alloc(TRUE)) == NULL) { - radlog(L_ERR|L_CONS, "no memory"); + radlog(L_ERR, "no memory"); exit(1); } diff --git a/src/main/session.c b/src/main/session.c index 87f6f37a189..d093ca5a334 100644 --- a/src/main/session.c +++ b/src/main/session.c @@ -53,7 +53,7 @@ int session_zap(REQUEST *request, uint32_t nasaddr, unsigned int port, #define PAIR(n,v,e) do { \ if(!(vp = paircreate(n, 0))) { \ request_free(&stopreq); \ - radlog(L_ERR|L_CONS, "no memory"); \ + radlog(L_ERR, "no memory"); \ pairfree(&(stopreq->packet->vps)); \ return 0; \ } \ @@ -65,7 +65,7 @@ int session_zap(REQUEST *request, uint32_t nasaddr, unsigned int port, #define STRINGPAIR(n,v) do { \ if(!(vp = paircreate(n, 0))) { \ request_free(&stopreq); \ - radlog(L_ERR|L_CONS, "no memory"); \ + radlog(L_ERR, "no memory"); \ pairfree(&(stopreq->packet->vps)); \ return 0; \ } \ diff --git a/src/modules/rlm_always/rlm_always.c b/src/modules/rlm_always/rlm_always.c index 56decf23f0b..b3993209b69 100644 --- a/src/modules/rlm_always/rlm_always.c +++ b/src/modules/rlm_always/rlm_always.c @@ -80,7 +80,7 @@ static rlm_rcode_t str2rcode(const char *s) else if(!strcasecmp(s, "updated")) return RLM_MODULE_UPDATED; else { - radlog(L_ERR|L_CONS, + radlog(L_ERR, "rlm_always: Unknown module rcode '%s'.\n", s); return RLM_MODULE_UNKNOWN; } diff --git a/src/modules/rlm_attr_filter/rlm_attr_filter.c b/src/modules/rlm_attr_filter/rlm_attr_filter.c index 676c6719a03..1ed3a41b44c 100644 --- a/src/modules/rlm_attr_filter/rlm_attr_filter.c +++ b/src/modules/rlm_attr_filter/rlm_attr_filter.c @@ -155,7 +155,7 @@ static int attr_filter_instantiate(CONF_SECTION *conf, void **instance) rcode = attr_filter_getfile(inst->file, &inst->attrs); if (rcode != 0) { - radlog(L_ERR|L_CONS, "Errors reading %s", inst->file); + radlog(L_ERR, "Errors reading %s", inst->file); attr_filter_detach(inst); return -1; } diff --git a/src/modules/rlm_eap/rlm_eap.c b/src/modules/rlm_eap/rlm_eap.c index b59c529c2ee..9bdb8bfaa4c 100644 --- a/src/modules/rlm_eap/rlm_eap.c +++ b/src/modules/rlm_eap/rlm_eap.c @@ -203,7 +203,7 @@ static int eap_instantiate(CONF_SECTION *cs, void **instance) } if (num_types == 0) { - radlog(L_ERR|L_CONS, "rlm_eap: No EAP type configured, module cannot do anything."); + radlog(L_ERR, "rlm_eap: No EAP type configured, module cannot do anything."); eap_detach(inst); return -1; } @@ -213,14 +213,14 @@ static int eap_instantiate(CONF_SECTION *cs, void **instance) */ eap_type = eaptype_name2type(inst->default_eap_type_name); if (eap_type < 0) { - radlog(L_ERR|L_CONS, "rlm_eap: Unknown default EAP type %s", + radlog(L_ERR, "rlm_eap: Unknown default EAP type %s", inst->default_eap_type_name); eap_detach(inst); return -1; } if (inst->types[eap_type] == NULL) { - radlog(L_ERR|L_CONS, "rlm_eap: No such sub-type for default EAP type %s", + radlog(L_ERR, "rlm_eap: No such sub-type for default EAP type %s", inst->default_eap_type_name); eap_detach(inst); return -1; @@ -238,7 +238,7 @@ static int eap_instantiate(CONF_SECTION *cs, void **instance) */ inst->session_tree = rbtree_create(eap_handler_cmp, NULL, 0); if (!inst->session_tree) { - radlog(L_ERR|L_CONS, "rlm_eap: Cannot initialize tree"); + radlog(L_ERR, "rlm_eap: Cannot initialize tree"); eap_detach(inst); return -1; } @@ -246,14 +246,14 @@ static int eap_instantiate(CONF_SECTION *cs, void **instance) if (fr_debug_flag) { inst->handler_tree = rbtree_create(eap_handler_ptr_cmp, NULL, 0); if (!inst->handler_tree) { - radlog(L_ERR|L_CONS, "rlm_eap: Cannot initialize tree"); + radlog(L_ERR, "rlm_eap: Cannot initialize tree"); eap_detach(inst); return -1; } #ifdef HAVE_PTHREAD_H if (pthread_mutex_init(&(inst->handler_mutex), NULL) < 0) { - radlog(L_ERR|L_CONS, "rlm_eap: Failed initializing mutex: %s", strerror(errno)); + radlog(L_ERR, "rlm_eap: Failed initializing mutex: %s", strerror(errno)); eap_detach(inst); return -1; } @@ -262,7 +262,7 @@ static int eap_instantiate(CONF_SECTION *cs, void **instance) #ifdef HAVE_PTHREAD_H if (pthread_mutex_init(&(inst->session_mutex), NULL) < 0) { - radlog(L_ERR|L_CONS, "rlm_eap: Failed initializing mutex: %s", strerror(errno)); + radlog(L_ERR, "rlm_eap: Failed initializing mutex: %s", strerror(errno)); eap_detach(inst); return -1; } diff --git a/src/modules/rlm_eap2/rlm_eap2.c b/src/modules/rlm_eap2/rlm_eap2.c index 2621886d810..395a3b390d4 100644 --- a/src/modules/rlm_eap2/rlm_eap2.c +++ b/src/modules/rlm_eap2/rlm_eap2.c @@ -556,7 +556,7 @@ static int eap_instantiate(CONF_SECTION *cs, void **instance) */ inst->session_tree = rbtree_create(eap_handler_cmp, NULL, 0); if (!inst->session_tree) { - radlog(L_ERR|L_CONS, "rlm_eap2: Cannot initialize tree"); + radlog(L_ERR, "rlm_eap2: Cannot initialize tree"); eap_detach(inst); return -1; } @@ -604,7 +604,7 @@ static int eap_instantiate(CONF_SECTION *cs, void **instance) inst->methods[num_types] = eap_server_get_type(buffer, &inst->vendors[num_types]); if (inst->methods[num_types] == EAP_TYPE_NONE) { - radlog(L_ERR|L_CONS, "rlm_eap2: Unknown EAP type %s", + radlog(L_ERR, "rlm_eap2: Unknown EAP type %s", auth_type); eap_detach(inst); return -1; @@ -630,7 +630,7 @@ static int eap_instantiate(CONF_SECTION *cs, void **instance) inst->num_types = num_types; if (do_tls && !has_tls) { - radlog(L_ERR|L_CONS, "rlm_eap2: TLS has not been configured. Cannot do methods that need TLS."); + radlog(L_ERR, "rlm_eap2: TLS has not been configured. Cannot do methods that need TLS."); eap_detach(inst); return -1; } @@ -640,7 +640,7 @@ static int eap_instantiate(CONF_SECTION *cs, void **instance) * Initialize TLS. */ if (eap_example_server_init_tls(inst) < 0) { - radlog(L_ERR|L_CONS, "rlm_eap2: Cannot initialize TLS"); + radlog(L_ERR, "rlm_eap2: Cannot initialize TLS"); eap_detach(inst); return -1; } diff --git a/src/modules/rlm_files/rlm_files.c b/src/modules/rlm_files/rlm_files.c index 8e266d58e18..ac938bf6ebb 100644 --- a/src/modules/rlm_files/rlm_files.c +++ b/src/modules/rlm_files/rlm_files.c @@ -357,14 +357,14 @@ static int file_instantiate(CONF_SECTION *conf, void **instance) rcode = getusersfile(inst->usersfile, &inst->users, inst->compat_mode); if (rcode != 0) { - radlog(L_ERR|L_CONS, "Errors reading %s", inst->usersfile); + radlog(L_ERR, "Errors reading %s", inst->usersfile); file_detach(inst); return -1; } rcode = getusersfile(inst->acctusersfile, &inst->acctusers, inst->compat_mode); if (rcode != 0) { - radlog(L_ERR|L_CONS, "Errors reading %s", inst->acctusersfile); + radlog(L_ERR, "Errors reading %s", inst->acctusersfile); file_detach(inst); return -1; } @@ -375,14 +375,14 @@ static int file_instantiate(CONF_SECTION *conf, void **instance) */ rcode = getusersfile(inst->preproxy_usersfile, &inst->preproxy_users, inst->compat_mode); if (rcode != 0) { - radlog(L_ERR|L_CONS, "Errors reading %s", inst->preproxy_usersfile); + radlog(L_ERR, "Errors reading %s", inst->preproxy_usersfile); file_detach(inst); return -1; } rcode = getusersfile(inst->postproxy_usersfile, &inst->postproxy_users, inst->compat_mode); if (rcode != 0) { - radlog(L_ERR|L_CONS, "Errors reading %s", inst->postproxy_usersfile); + radlog(L_ERR, "Errors reading %s", inst->postproxy_usersfile); file_detach(inst); return -1; } @@ -390,14 +390,14 @@ static int file_instantiate(CONF_SECTION *conf, void **instance) rcode = getusersfile(inst->auth_usersfile, &inst->auth_users, inst->compat_mode); if (rcode != 0) { - radlog(L_ERR|L_CONS, "Errors reading %s", inst->auth_usersfile); + radlog(L_ERR, "Errors reading %s", inst->auth_usersfile); file_detach(inst); return -1; } rcode = getusersfile(inst->postauth_usersfile, &inst->postauth_users, inst->compat_mode); if (rcode != 0) { - radlog(L_ERR|L_CONS, "Errors reading %s", inst->postauth_usersfile); + radlog(L_ERR, "Errors reading %s", inst->postauth_usersfile); file_detach(inst); return -1; } diff --git a/src/modules/rlm_otp/otp_util.c b/src/modules/rlm_otp/otp_util.c index 7f23cad4abc..f9c6b2b5108 100644 --- a/src/modules/rlm_otp/otp_util.c +++ b/src/modules/rlm_otp/otp_util.c @@ -88,7 +88,7 @@ void _otp_pthread_mutex_init(pthread_mutex_t *mutexp, rc = pthread_mutex_init(mutexp, attr); if (rc) { - radlog(L_ERR|L_CONS, "rlm_otp: %s: pthread_mutex_init: %s", + radlog(L_ERR, "rlm_otp: %s: pthread_mutex_init: %s", caller, strerror(rc)); exit(1); @@ -104,7 +104,7 @@ void _otp_pthread_mutex_lock(pthread_mutex_t *mutexp, const char *caller) rc = pthread_mutex_lock(mutexp); if (rc) { - radlog(L_ERR|L_CONS, "rlm_otp: %s: pthread_mutex_lock: %s", + radlog(L_ERR, "rlm_otp: %s: pthread_mutex_lock: %s", caller, strerror(rc)); exit(1); @@ -120,7 +120,7 @@ int _otp_pthread_mutex_trylock(pthread_mutex_t *mutexp, const char *caller) rc = pthread_mutex_trylock(mutexp); if (rc && rc != EBUSY) { - radlog(L_ERR|L_CONS, "rlm_otp: %s: pthread_mutex_trylock: %s", + radlog(L_ERR, "rlm_otp: %s: pthread_mutex_trylock: %s", caller, strerror(rc)); exit(1); @@ -138,7 +138,7 @@ void _otp_pthread_mutex_unlock(pthread_mutex_t *mutexp, const char *caller) rc = pthread_mutex_unlock(mutexp); if (rc) { - radlog(L_ERR|L_CONS, "rlm_otp: %s: pthread_mutex_unlock: %s", + radlog(L_ERR, "rlm_otp: %s: pthread_mutex_unlock: %s", caller, strerror(rc)); exit(1); diff --git a/src/modules/rlm_otp/rlm_otp.c b/src/modules/rlm_otp/rlm_otp.c index d7282d0d2e8..1891c93b4cd 100644 --- a/src/modules/rlm_otp/rlm_otp.c +++ b/src/modules/rlm_otp/rlm_otp.c @@ -147,7 +147,7 @@ static int otp_instantiate(CONF_SECTION *conf, void **instance) } if (!opt->name) { - radlog(L_ERR|L_CONS, "rlm_otp: %s: no instance name " + radlog(L_ERR, "rlm_otp: %s: no instance name " "(this can't happen)", __func__); free(opt); return -1; diff --git a/src/modules/rlm_preprocess/rlm_preprocess.c b/src/modules/rlm_preprocess/rlm_preprocess.c index 5ef2f172183..999b5ce1e02 100644 --- a/src/modules/rlm_preprocess/rlm_preprocess.c +++ b/src/modules/rlm_preprocess/rlm_preprocess.c @@ -553,7 +553,7 @@ static int preprocess_instantiate(CONF_SECTION *conf, void **instance) rcode = pairlist_read(data->huntgroup_file, &(data->huntgroups), 0); if (rcode < 0) { - radlog(L_ERR|L_CONS, "rlm_preprocess: Error reading %s", + radlog(L_ERR, "rlm_preprocess: Error reading %s", data->huntgroup_file); return -1; } @@ -565,7 +565,7 @@ static int preprocess_instantiate(CONF_SECTION *conf, void **instance) if (data->hints_file) { rcode = pairlist_read(data->hints_file, &(data->hints), 0); if (rcode < 0) { - radlog(L_ERR|L_CONS, "rlm_preprocess: Error reading %s", + radlog(L_ERR, "rlm_preprocess: Error reading %s", data->hints_file); return -1; } diff --git a/src/modules/rlm_python/rlm_python.c b/src/modules/rlm_python/rlm_python.c index 2ac817fb11f..5f0bd67e334 100644 --- a/src/modules/rlm_python/rlm_python.c +++ b/src/modules/rlm_python/rlm_python.c @@ -112,7 +112,6 @@ static struct { A(L_INFO) A(L_ERR) A(L_PROXY) - A(L_CONS) A(RLM_MODULE_REJECT) A(RLM_MODULE_FAIL) A(RLM_MODULE_OK) @@ -161,7 +160,7 @@ static PyMethodDef radiusd_methods[] = { { "radlog", &python_radlog, METH_VARARGS, "radiusd.radlog(level, msg)\n\n" \ "Print a message using radiusd logging system. level should be one of the\n" \ - "constants L_DBG, L_AUTH, L_INFO, L_ERR, L_PROXY, L_CONS\n" + "constants L_DBG, L_AUTH, L_INFO, L_ERR, L_PROXY\n" }, { NULL, NULL, 0, NULL }, }; diff --git a/src/modules/rlm_realm/rlm_realm.c b/src/modules/rlm_realm/rlm_realm.c index 58a18ff25ce..a7139f98048 100644 --- a/src/modules/rlm_realm/rlm_realm.c +++ b/src/modules/rlm_realm/rlm_realm.c @@ -336,7 +336,7 @@ static void add_proxy_to_realm(VALUE_PAIR **vps, REALM *realm) */ vp = pairmake("Proxy-To-Realm", realm->name, T_OP_EQ); if (!vp) { - radlog(L_ERR|L_CONS, "no memory"); + radlog(L_ERR, "no memory"); exit(1); } diff --git a/src/modules/rlm_ruby/rlm_ruby.c b/src/modules/rlm_ruby/rlm_ruby.c index b1a0c08005f..385b8973fd0 100644 --- a/src/modules/rlm_ruby/rlm_ruby.c +++ b/src/modules/rlm_ruby/rlm_ruby.c @@ -296,7 +296,6 @@ static struct varlookup { { "L_INFO", L_INFO}, { "L_ERR", L_ERR}, { "L_PROXY", L_PROXY}, - { "L_CONS", L_CONS}, { "RLM_MODULE_REJECT", RLM_MODULE_REJECT}, { "RLM_MODULE_FAIL", RLM_MODULE_FAIL}, { "RLM_MODULE_OK", RLM_MODULE_OK}, diff --git a/src/modules/rlm_securid/rlm_securid.c b/src/modules/rlm_securid/rlm_securid.c index 2e2abc88126..c17d1b0297a 100644 --- a/src/modules/rlm_securid/rlm_securid.c +++ b/src/modules/rlm_securid/rlm_securid.c @@ -403,7 +403,7 @@ static SECURID_AUTH_RC securidAuth(void *instance, REQUEST *request, return rc; default: - radlog(L_ERR|L_CONS, "rlm_securid: Invalid session state %d for user [%s]", + radlog(L_ERR, "rlm_securid: Invalid session state %d for user [%s]", pSecurid_session->securidSessionState, username); break; @@ -443,7 +443,7 @@ static rlm_rcode_t securid_instantiate(CONF_SECTION *conf, void **instance) /* If the configuration parameters can't be parsed, then fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { - radlog(L_ERR|L_CONS, "rlm_securid: Unable to parse configuration section."); + radlog(L_ERR, "rlm_securid: Unable to parse configuration section."); securid_detach(inst); return -1; } @@ -454,7 +454,7 @@ static rlm_rcode_t securid_instantiate(CONF_SECTION *conf, void **instance) */ inst->session_tree = rbtree_create(securid_session_cmp, NULL, 0); if (!inst->session_tree) { - radlog(L_ERR|L_CONS, "rlm_securid: Cannot initialize session tree."); + radlog(L_ERR, "rlm_securid: Cannot initialize session tree."); securid_detach(inst); return -1; } diff --git a/src/modules/rlm_smsotp/rlm_smsotp.c b/src/modules/rlm_smsotp/rlm_smsotp.c index 8c4f20ad33c..3db22bb5033 100644 --- a/src/modules/rlm_smsotp/rlm_smsotp.c +++ b/src/modules/rlm_smsotp/rlm_smsotp.c @@ -409,7 +409,7 @@ static void _smsotp_pthread_mutex_init(pthread_mutex_t *mutexp, const pthread_mu int rc; if ((rc = pthread_mutex_init(mutexp, attr))) { - (void) radlog(L_ERR|L_CONS, "rlm_smsotp: %s: pthread_mutex_init: %s", caller, strerror(rc)); + (void) radlog(L_ERR, "rlm_smsotp: %s: pthread_mutex_init: %s", caller, strerror(rc)); exit(1); } } @@ -420,7 +420,7 @@ static void _smsotp_pthread_mutex_lock(pthread_mutex_t *mutexp, const char *call int rc; if ((rc = pthread_mutex_lock(mutexp))) { - (void) radlog(L_ERR|L_CONS, "rlm_smsotp: %s: pthread_mutex_lock: %s", caller, strerror(rc)); + (void) radlog(L_ERR, "rlm_smsotp: %s: pthread_mutex_lock: %s", caller, strerror(rc)); exit(1); } } @@ -432,7 +432,7 @@ static int _smsotp_pthread_mutex_trylock(pthread_mutex_t *mutexp, const char *ca rc = pthread_mutex_trylock(mutexp); if (rc && rc != EBUSY) { - (void) radlog(L_ERR|L_CONS, "rlm_smsotp: %s: pthread_mutex_trylock: %s", caller, strerror(rc)); + (void) radlog(L_ERR, "rlm_smsotp: %s: pthread_mutex_trylock: %s", caller, strerror(rc)); exit(1); } @@ -445,7 +445,7 @@ static void _smsotp_pthread_mutex_unlock(pthread_mutex_t *mutexp, const char *ca int rc; if ((rc = pthread_mutex_unlock(mutexp))) { - (void) radlog(L_ERR|L_CONS, "rlm_smsotp: %s: pthread_mutex_unlock: %s", caller, strerror(rc)); + (void) radlog(L_ERR, "rlm_smsotp: %s: pthread_mutex_unlock: %s", caller, strerror(rc)); exit(1); } } diff --git a/src/modules/rlm_sometimes/rlm_sometimes.c b/src/modules/rlm_sometimes/rlm_sometimes.c index 6bbb9b80872..4763ffaa258 100644 --- a/src/modules/rlm_sometimes/rlm_sometimes.c +++ b/src/modules/rlm_sometimes/rlm_sometimes.c @@ -85,7 +85,7 @@ static int str2rcode(const char *s) else if(!strcasecmp(s, "updated")) return RLM_MODULE_UPDATED; else { - radlog(L_ERR|L_CONS, + radlog(L_ERR, "rlm_sometimes: Unknown module rcode '%s'.\n", s); return -1; } diff --git a/src/modules/rlm_sql/drivers/rlm_sql_iodbc/rlm_sql_iodbc.c b/src/modules/rlm_sql/drivers/rlm_sql_iodbc/rlm_sql_iodbc.c index d73e6e01867..d0fc690994d 100644 --- a/src/modules/rlm_sql/drivers/rlm_sql_iodbc/rlm_sql_iodbc.c +++ b/src/modules/rlm_sql/drivers/rlm_sql_iodbc/rlm_sql_iodbc.c @@ -72,7 +72,7 @@ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rcode = SQLAllocEnv(&iodbc_sock->env_handle); if (!SQL_SUCCEEDED(rcode)) { - radlog(L_CONS|L_ERR, "sql_create_socket: SQLAllocEnv failed: %s", + radlog(L_ERR, "sql_create_socket: SQLAllocEnv failed: %s", sql_error(sqlsocket, config)); return -1; } @@ -80,7 +80,7 @@ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rcode = SQLAllocConnect(iodbc_sock->env_handle, &iodbc_sock->dbc_handle); if (!SQL_SUCCEEDED(rcode)) { - radlog(L_CONS|L_ERR, "sql_create_socket: SQLAllocConnect failed: %s", + radlog(L_ERR, "sql_create_socket: SQLAllocConnect failed: %s", sql_error(sqlsocket, config)); return -1; } @@ -89,7 +89,7 @@ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { SQL_NTS, config->sql_login, SQL_NTS, config->sql_password, SQL_NTS); if (!SQL_SUCCEEDED(rcode)) { - radlog(L_CONS|L_ERR, "sql_create_socket: SQLConnectfailed: %s", + radlog(L_ERR, "sql_create_socket: SQLConnectfailed: %s", sql_error(sqlsocket, config)); return -1; } @@ -127,7 +127,7 @@ static int sql_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { rcode = SQLAllocStmt(iodbc_sock->dbc_handle, &iodbc_sock->stmt_handle); if (!SQL_SUCCEEDED(rcode)) { - radlog(L_CONS|L_ERR, "sql_create_socket: SQLAllocStmt failed: %s", + radlog(L_ERR, "sql_create_socket: SQLAllocStmt failed: %s", sql_error(sqlsocket, config)); return -1; } @@ -139,7 +139,7 @@ static int sql_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { rcode = SQLExecDirect(iodbc_sock->stmt_handle, querystr, SQL_NTS); if (!SQL_SUCCEEDED(rcode)) { - radlog(L_CONS|L_ERR, "sql_query: failed: %s", + radlog(L_ERR, "sql_query: failed: %s", sql_error(sqlsocket, config)); return -1; } diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index a068c25081d..ce78623a7eb 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -342,7 +342,7 @@ static int generate_sql_clients(SQL_INST *inst) * Always get the numeric representation of IP */ if (ip_hton(row[1], AF_UNSPEC, &c->ipaddr) < 0) { - radlog(L_CONS|L_ERR, "rlm_sql (%s): Failed to look up hostname %s: %s", + radlog(L_ERR, "rlm_sql (%s): Failed to look up hostname %s: %s", inst->config->xlat_name, row[1], fr_strerror()); free(c); diff --git a/src/modules/rlm_sql/sql.c b/src/modules/rlm_sql/sql.c index 02cb305e114..d42d2f84ad1 100644 --- a/src/modules/rlm_sql/sql.c +++ b/src/modules/rlm_sql/sql.c @@ -395,7 +395,7 @@ int sql_getvpdata(SQL_INST * inst, SQLSOCK **sqlsocket, VALUE_PAIR **pair, char if (!row) break; if (sql_userparse(pair, row) != 0) { - radlog(L_ERR | L_CONS, "rlm_sql (%s): Error getting data from database", inst->config->xlat_name); + radlog(L_ERR, "rlm_sql (%s): Error getting data from database", inst->config->xlat_name); (inst->module->sql_finish_select_query)(*sqlsocket, inst->config);