net-snmp: add early return when Mode is unset
authorEric McDonald <redacted>
Sat, 7 Mar 2026 21:45:22 +0000 (13:45 -0800)
committerFlorian Eckert <redacted>
Wed, 11 Mar 2026 08:07:04 +0000 (09:07 +0100)
commitc3862ec354ab7957a54bffc8af4fe2b27b84eb13
treec129d13d0fb71bb8fdac14209072d847fcc71f3d
parentfb71da41da4e50bad0920495c792dd65960b0475
net-snmp: add early return when Mode is unset

snmpd_access_default_add, snmpd_access_HostName_add, and
snmpd_access_HostIP_add would write unintended output to the
config file if the Mode option is not specified. Add an early
return to each function to prevent writing in that case.

This is a breaking change for configs where Mode is unset.
Previously, an empty Mode option would result in a malformed
directive with a leading space and no guaranteed newline, the
exact form of which depended on the values of other options.
Now, no directive is written.

Signed-off-by: Eric McDonald <redacted>
net/net-snmp/files/snmpd.init
git clone https://git.99rst.org/PROJECT