From 743e6393ebe9529a50b2efee38124aa6650e28b7 Mon Sep 17 00:00:00 2001 From: Eric McDonald Date: Thu, 4 Dec 2025 09:48:16 -0800 Subject: [PATCH] net-snmp: fix literal string test in snmpd_sink_add The function snmpd_sink_add() has a guard clause that tests the literal string "section", not the variable value "$section". The test `[ -n "section" ]` always evaluates to true because the string literal "section" is non-empty, making the check useless. This function is only called internally with hardcoded arguments, so the bug has no actual impact currently. For the same reason, this change should not break existing configurations. However, I think it should be fixed so future callers do not have a false sense of security. Signed-off-by: Eric McDonald --- net/net-snmp/files/snmpd.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/net-snmp/files/snmpd.init b/net/net-snmp/files/snmpd.init index e28e54ec8ce380..78df7c9a2bda60 100644 --- a/net/net-snmp/files/snmpd.init +++ b/net/net-snmp/files/snmpd.init @@ -233,7 +233,7 @@ snmpd_sink_add() { local host config_get host "$cfg" host - [ -n "section" -a -n "$host" ] || return 0 + [ -n "$section" -a -n "$host" ] || return 0 # optional community config_get community "$cfg" community # optional port