From ec1399c9a24285f8bba3dc689fbbd0c1e7ea212b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 18 Jan 2023 14:36:18 +0100 Subject: [PATCH] plugins: replace relevant log_error() with log_msg() calls PR: https://github.com/opnsense/core/issues/6115 --- net/frr/src/etc/rc.syshook.d/carp/50-frr | 4 ++-- net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns | 4 ++-- net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc | 7 ++++--- security/softether/src/etc/rc.syshook.d/carp/50-softether | 4 ++-- www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php | 5 +---- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/net/frr/src/etc/rc.syshook.d/carp/50-frr b/net/frr/src/etc/rc.syshook.d/carp/50-frr index 05c8c0e8d..5ffb4ca82 100755 --- a/net/frr/src/etc/rc.syshook.d/carp/50-frr +++ b/net/frr/src/etc/rc.syshook.d/carp/50-frr @@ -38,12 +38,12 @@ if (frr_carp_enabled()) { $type = !empty($argv[2]) ? $argv[2] : ''; if ($type != 'MASTER' && $type != 'BACKUP') { - log_error("Carp '$type' event unknown from source '{$subsystem}'"); + log_msg("Carp '$type' event unknown from source '{$subsystem}'"); exit(1); } if (!strstr($subsystem, '@')) { - log_error("Carp '$type' event triggered from wrong source '{$subsystem}'"); + log_msg("Carp '$type' event triggered from wrong source '{$subsystem}'"); exit(1); } diff --git a/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns b/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns index 07c1bb207..25af77e52 100755 --- a/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns +++ b/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns @@ -42,12 +42,12 @@ if ($mdns_repeater_carp_enabled) { $type = !empty($argv[2]) ? $argv[2] : ''; if ($type != 'MASTER' && $type != 'BACKUP') { - log_error("Carp '$type' event unknown from source '{$subsystem}'"); + log_msg("Carp '$type' event unknown from source '{$subsystem}'"); exit(1); } if (!strstr($subsystem, '@')) { - log_error("Carp '$type' event triggered from wrong source '{$subsystem}'"); + log_msg("Carp '$type' event triggered from wrong source '{$subsystem}'"); exit(1); } diff --git a/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc b/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc index 4da5c9c02..5ea4d0683 100644 --- a/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc +++ b/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc @@ -159,10 +159,10 @@ function miniupnpd_configure_do($verbose = false) $ifaces_active .= ", {$iface}"; } } else { - log_error("miniupnpd: Interface {$iface} has no ip address, ignoring"); + log_msg("miniupnpd: Interface {$iface} has no ip address, ignoring", LOG_WARING); } } else { - log_error("miniupnpd: Could not resolve real interface for {$iface}"); + log_msg("miniupnpd: Could not resolve real interface for {$iface}", LOG_ERR); } } @@ -238,7 +238,8 @@ function miniupnpd_configure_do($verbose = false) /* write out the configuration */ file_put_contents('/var/etc/miniupnpd.conf', $config_text); - log_error("miniupnpd: Starting service on interface: {$ifaces_active}"); + log_msg("miniupnpd: Starting service on interface: {$ifaces_active}"); + miniupnpd_start(); } } diff --git a/security/softether/src/etc/rc.syshook.d/carp/50-softether b/security/softether/src/etc/rc.syshook.d/carp/50-softether index ca50c43ca..71d3e58ae 100755 --- a/security/softether/src/etc/rc.syshook.d/carp/50-softether +++ b/security/softether/src/etc/rc.syshook.d/carp/50-softether @@ -39,12 +39,12 @@ if (softether_carp_enabled()) { $type = !empty($argv[2]) ? $argv[2] : ''; if ($type != 'MASTER' && $type != 'BACKUP') { - log_error("Carp '$type' event unknown from source '{$subsystem}'"); + log_msg("Carp '$type' event unknown from source '{$subsystem}'"); exit(1); } if (!strstr($subsystem, '@')) { - log_error("Carp '$type' event triggered from wrong source '{$subsystem}'"); + log_msg("Carp '$type' event triggered from wrong source '{$subsystem}'"); exit(1); } diff --git a/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php b/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php index 721b3832c..63e5c6f7a 100755 --- a/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php +++ b/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php @@ -166,12 +166,9 @@ function create_work_files($include_tls_handshake) @touch($target); $work_files[] = $target; } else { - log_error("Failed renaming '$source' to '$target'. Skipping source for next run."); + log_msg("Failed renaming '$source' to '$target'. Skipping source for next run."); } } - } else { - //Concurrent invocation. Can be silently ignored since no work files are collected. - //log_error("Skipping processing. Missing: " . join(", ", array_diff(array_keys($mapping), $existing_sources))); } reopen_logs();