net-snmp: add early return when HostName is unset
authorEric McDonald <redacted>
Sat, 7 Mar 2026 21:50:13 +0000 (13:50 -0800)
committerFlorian Eckert <redacted>
Wed, 11 Mar 2026 08:07:04 +0000 (09:07 +0100)
commit8033cfc287257ce2507999dd8ee332655cf554d5
tree1b324b464023f5321b0eec22f4dc8a0e2e3c86d5
parentdbd293d75186eba31e99f4a6feed5193b53107fc
net-snmp: add early return when HostName is unset

snmpd_access_HostName_add would write unintended output to the
config file if the HostName option is not specified. Add an early
return to prevent writing in that case.

This is a breaking change for configs where HostName is unset.
Previously, an empty HostName option would result in a malformed
directive with a trailing 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