net-snmp: fix literal string test in snmpd_sink_add
authorEric McDonald <librick-openwrt@proton.me>
Thu, 4 Dec 2025 17:48:16 +0000 (09:48 -0800)
committerStijn Tintel <stijn@linux-ipv6.be>
Sun, 14 Dec 2025 21:52:39 +0000 (23:52 +0200)
commit93983e5b2ad7bac5e384bdd6cdcf471bbfe3eb55
treee561636a015f94e2500a85d6adfc3f61576eca5f
parent65d83de7f8b6969f1aa04895ddf20cc7ba690248
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 <librick-openwrt@proton.me>
net/net-snmp/files/snmpd.init