]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
strerror: Use PERROR() where available
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 6 Apr 2020 19:38:04 +0000 (14:38 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 6 Apr 2020 21:26:42 +0000 (16:26 -0500)
13 files changed:
raddb/mods-config/perl/example.pl
src/bin/radiusd.c
src/lib/io/network.c
src/lib/io/schedule.c
src/lib/server/dependency.c
src/lib/server/module.c
src/lib/server/virtual_servers.c
src/lib/util/event.c
src/modules/proto_bfd/proto_bfd.c
src/modules/proto_dhcpv4/dhcpclient.c
src/modules/proto_vmps/proto_vmps.c
src/modules/rlm_eap/rlm_eap.c
src/modules/rlm_ldap/user.c

index bb23f0c76e3a2300cd20b84bce9ddc6125bb1e1c..8aaa19152abd38a1582342388fa8e8a76ace3935 100644 (file)
@@ -186,8 +186,8 @@ sub xlat {
 
        # Loads some external perl and evaluate it
        my ($filename,$a,$b,$c,$d) = @_;
-       radiusd::radlog(L_DBG, "From xlat $filename ");
-       radiusd::radlog(L_DBG,"From xlat $a $b $c $d ");
+       radiusd::radlog(L_DBG, "From xlat $filename");
+       radiusd::radlog(L_DBG,"From xlat $a $b $c $d");
        local *FH;
        open FH, $filename or die "open '$filename' $!";
        local($/) = undef;
index 1ed42480bc67102f9a824ebd4818cb84ac495928..1ff4206cd0e5bdd58e921b6749c231d688959509 100644 (file)
@@ -790,7 +790,7 @@ int main(int argc, char *argv[])
                sc = fr_schedule_create(NULL, el, &default_log, fr_debug_lvl,
                                        thread_instantiate, thread_detach, schedule);
                if (!sc) {
-                       PERROR("Failed starting the scheduler: %s", fr_strerror());
+                       PERROR("Failed starting the scheduler");
                        EXIT_WITH_FAILURE;
                }
 
index 591885f1199b9210459bb3fb187877ceb3a6d3e4..0985ae2d958c617255408c273584d445df1eab68 100644 (file)
@@ -883,7 +883,7 @@ static void fr_network_listen_callback(void *ctx, void const *data, size_t data_
                                      sizeof(fr_channel_data_t),
                                      size);
        if (!s->ms) {
-               ERROR("Failed creating message buffers for network IO: %s", fr_strerror());
+               PERROR("Failed creating message buffers for network IO");
                talloc_free(s);
                return;
        }
@@ -949,7 +949,7 @@ static void fr_network_directory_callback(void *ctx, void const *data, size_t da
                                      sizeof(fr_channel_data_t),
                                      s->listen->default_message_size * s->listen->num_messages);
        if (!s->ms) {
-               ERROR("Failed creating message buffers for directory IO: %s", fr_strerror());
+               PERROR("Failed creating message buffers for directory IO");
                talloc_free(s);
                return;
        }
index d787f043020b1c4d8d76d7be2f98e088617b4aee..4cf2337bdceef6f4b69f64594dca5e7eef523d11 100644 (file)
@@ -423,7 +423,7 @@ fr_schedule_t *fr_schedule_create(TALLOC_CTX *ctx, fr_event_list_t *el,
        if (el) {
                sc->single_network = fr_network_create(sc, el, 0, sc->log, sc->lvl);
                if (!sc->single_network) {
-                       ERROR("Failed creating network: %s", fr_strerror());
+                       PERROR("Failed creating network");
                pre_instantiate_st_fail:
                        talloc_free(sc);
                        return NULL;
@@ -431,7 +431,7 @@ fr_schedule_t *fr_schedule_create(TALLOC_CTX *ctx, fr_event_list_t *el,
 
                sc->single_worker = fr_worker_create(sc, "0", el, sc->log, sc->lvl);
                if (!sc->single_worker) {
-                       ERROR("Failed creating worker: %s", fr_strerror());
+                       PERROR("Failed creating worker");
                        goto pre_instantiate_st_fail;
                }
 
@@ -445,20 +445,20 @@ fr_schedule_t *fr_schedule_create(TALLOC_CTX *ctx, fr_event_list_t *el,
                        if (!subcs) subcs = cf_section_find(sc->cs, "worker", NULL);
 
                        if (sc->worker_thread_instantiate(sc->single_worker, el, subcs) < 0) {
-                               ERROR("Failed calling thread instantiate: %s", fr_strerror());
+                               PERROR("Failed calling thread instantiate");
                                goto pre_instantiate_st_fail;
                        }
                }
 
                if (fr_command_register_hook(NULL, "0", sc->single_worker, cmd_worker_table) < 0) {
-                       ERROR("Failed adding worker commands: %s", fr_strerror());
+                       PERROR("Failed adding worker commands");
                st_fail:
                        if (sc->worker_thread_detach) sc->worker_thread_detach(NULL);
                        goto pre_instantiate_st_fail;
                }
 
                if (fr_command_register_hook(NULL, "0", sc->single_network, cmd_network_table) < 0) {
-                       ERROR("Failed adding network commands: %s", fr_strerror());
+                       PERROR("Failed adding network commands");
                        goto st_fail;
                }
 
@@ -525,7 +525,7 @@ fr_schedule_t *fr_schedule_create(TALLOC_CTX *ctx, fr_event_list_t *el,
        sc->sn->id = 0;
 
        if (fr_schedule_pthread_create(&sc->sn->pthread_id, fr_schedule_network_thread, sc->sn) < 0) {
-               ERROR("Failed creating network thread %s", fr_strerror());
+               PERROR("Failed creating network thread");
                goto fail;
        }
 
@@ -608,13 +608,13 @@ fr_schedule_t *fr_schedule_create(TALLOC_CTX *ctx, fr_event_list_t *el,
 
                snprintf(buffer, sizeof(buffer), "%d", i);
                if (fr_command_register_hook(NULL, buffer, sw->worker, cmd_worker_table) < 0) {
-                       ERROR("Failed adding worker commands: %s", fr_strerror());
+                       PERROR("Failed adding worker commands");
                        goto st_fail;
                }
        }
 
        if (fr_command_register_hook(NULL, "0", sc->sn->nr, cmd_network_table) < 0) {
-               ERROR("Failed adding network commands: %s", fr_strerror());
+               PERROR("Failed adding network commands");
                goto st_fail;
        }
 
index 0e410ec0b8d0ebaadce8b54bc46549969b6983eb..a8ccc90f7e1d51595ee59885e6f80584a0e361d0 100644 (file)
@@ -602,7 +602,7 @@ void dependency_version_print(void)
                MEM(versions = cf_section_alloc(NULL, NULL, "version", NULL));
                dependency_version_numbers_init(versions);
 
-               DEBUG2("Server was built with: ");
+               DEBUG2("Server was built with:");
 
                for (ci = cf_item_next(features, NULL);
                     ci;
index fd567a86d26244cbec5ff7ef46ba079cf3432f56..b619ac03b0ad442884d52bac662fbdff1b241fd4 100644 (file)
@@ -1814,8 +1814,7 @@ int modules_bootstrap(CONF_SECTION *root)
        cf_log_debug(modules, " } # modules");
 
        if (fr_command_register_hook(NULL, NULL, modules, cmd_table) < 0) {
-               ERROR("Failed registering radmin commands for modules - %s",
-                     fr_strerror());
+               PERROR("Failed registering radmin commands for modules");
                return -1;
        }
 
index bc9f74b905ee270a36ce4dcbcef96dc063fef8b6..6cd5f2d3488500dfe5789445250bbdc28e335b7d 100644 (file)
@@ -509,8 +509,7 @@ int virtual_servers_instantiate(void)
        DEBUG2("#### Instantiating listeners ####");
 
        if (fr_command_register_hook(NULL, NULL, virtual_server_root, cmd_table) < 0) {
-               ERROR("Failed registering radmin commands for virtual servers - %s",
-                     fr_strerror());
+               PERROR("Failed registering radmin commands for virtual servers");
                return -1;
        }
 
index edb62ba77b5def6a6085945ba729fd11ea4440a3..a6b4a2c3897b2cf78438d35e312221a383302844 100644 (file)
@@ -53,7 +53,7 @@ DIAG_ON(unused-macros)
 #endif
 
 #ifdef WITH_EVENT_DEBUG
-#  define EVENT_DEBUG(fmt, ...) printf("EVENT: ");printf(fmt, ## __VA_ARGS__);printf("\n");fflush(stdout)
+#  define EVENT_DEBUG(fmt, ...) printf("EVENT:");printf(fmt, ## __VA_ARGS__);printf("\n");fflush(stdout)
 #else
 #  define EVENT_DEBUG(...)
 #endif
index 74cf28448e86ba7182704aae6bff945e89ca71f1..e4fbebcf3094a9a90c5789207be52a2efa75dcf0 100644 (file)
@@ -372,7 +372,7 @@ static int bfd_pthread_create(bfd_state_t *session)
        if (fr_schedule_pthread_create(&session->pthread_id, bfd_child_thread, session) < 0) {
                talloc_free(session->el);
                session->el = NULL;
-               ERROR("Thread create failed: %s", fr_strerror());
+               PERROR("Thread create failed");
                goto close_pipes;
        }
        pthread_attr_destroy(&attr);
index 79209baa2652c3dfb97d220e72d3dd2721b7af9e..2892a4d46a848faee0f4f9de8fec178f437e2a8a 100644 (file)
@@ -423,12 +423,12 @@ static int send_with_socket(RADIUS_PACKET **reply, RADIUS_PACKET *packet)
        {
                sockfd = fr_socket_server_udp(&packet->src_ipaddr, &packet->src_port, NULL, false);
                if (sockfd < 0) {
-                       ERROR("Error opening socket: %s", fr_strerror());
+                       PERROR("Error opening socket");
                        return -1;
                }
 
                if (fr_socket_bind(sockfd, &packet->src_ipaddr, &packet->src_port, NULL) < 0) {
-                       ERROR("Error binding socket: %s", fr_strerror());
+                       PERROR("Error binding socket");
                        return -1;
                }
        }
index b95266ca08cbd745ddaf873eb546b36d0bc34434..f11b17843cb36f3525cca78f385db8e91f1e3a69 100644 (file)
@@ -572,7 +572,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf)
 static int mod_load(void)
 {
        if (fr_vqp_init() < 0) {
-               ERROR("Failed initializing the VMPS dictionaries: %s", fr_strerror());
+               PERROR("Failed initializing the VMPS dictionaries");
                return -1;
        }
 
index 74b2cfec8c938f5f9b772dad9014d4ef0a85329c..0590cb2ab79e86c60e8ca0f84ad1adf939b8d678 100644 (file)
@@ -265,7 +265,7 @@ static eap_type_t eap_process_nak(rlm_eap_t *inst, REQUEST *request,
                 *      common choices.
                 */
                if (nak->data[i] == 0) {
-                       REDEBUG("Peer NAK'd indicating it is not willing to continue ");
+                       REDEBUG("Peer NAK'd indicating it is not willing to continue");
 
                        return FR_EAP_METHOD_INVALID;
                }
index 64f1fe9708f54e143553db584a31a5d7f26974d8..f16cfa581c5d48cc8204cf032e6a3ff90a9c1c2d 100644 (file)
@@ -292,7 +292,7 @@ void rlm_ldap_check_reply(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn
                        RWDEBUG2("!!! Found map between LDAP attribute and a FreeRADIUS password attribute");
                        RWDEBUG2("!!! eDirectory does not allow passwords to be retrieved via LDAP search");
                        RWDEBUG2("!!! Remove the password map and either:");
-                       RWDEBUG2("!!!  - Set 'edir = yes' and enable the universal password feature on your ");
+                       RWDEBUG2("!!!  - Set 'edir = yes' and enable the universal password feature on your");
                        RWDEBUG2("!!!    eDir server (recommended)");
                        RWDEBUG2("!!!    that password attribute");
                        RWDEBUG2("!!!  - Bind as the user by listing %s in the authenticate section, and",
@@ -307,7 +307,7 @@ void rlm_ldap_check_reply(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn
                                RWDEBUG2("!!! Found map between LDAP attribute and a FreeRADIUS password attribute");
                                RWDEBUG2("!!! but no password attribute found in search result");
                                RWDEBUG2("!!! Either:");
-                               RWDEBUG2("!!!  - Ensure the user object contains a password attribute, and that ");
+                               RWDEBUG2("!!!  - Ensure the user object contains a password attribute, and that");
                                RWDEBUG2("!!!    \"%s\" has permission to read that password attribute (recommended)",
                                         conn->config->admin_identity);
                                RWDEBUG2("!!!  - Bind as the user by listing %s in the authenticate section, and",
@@ -319,7 +319,7 @@ void rlm_ldap_check_reply(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn
                                RWDEBUG2("!!! No \"known good\" password added");
                                RWDEBUG2("!!! but no password attribute found in search result");
                                RWDEBUG2("!!! Either:");
-                               RWDEBUG2("!!!  - Ensure the user object contains a password attribute, and that ");
+                               RWDEBUG2("!!!  - Ensure the user object contains a password attribute, and that");
                                RWDEBUG2("!!!    'identity' is set to the DN of an account that has permission to read");
                                RWDEBUG2("!!!    that password attribute");
                                RWDEBUG2("!!!  - Bind as the user by listing %s in the authenticate section, and",