<feed xmlns='http://www.w3.org/2005/Atom'>
<title>packages/net/net-snmp/files/snmpd.init, branch master</title>
<subtitle>Mirror of packages feed</subtitle>
<id>https://git-03.infra.openwrt.org/feed/packages/atom?h=master</id>
<link rel='self' href='https://git-03.infra.openwrt.org/feed/packages/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/'/>
<updated>2026-03-11T08:07:04Z</updated>
<entry>
<title>net-snmp: fix newline when RestrictOID is neither yes nor no</title>
<updated>2026-03-11T08:07:04Z</updated>
<author>
<name>Eric McDonald</name>
</author>
<published>2026-03-07T22:29:16Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=136bff9a8e85755bdb132d741a8e2f5937d3ba57'/>
<id>urn:sha1:136bff9a8e85755bdb132d741a8e2f5937d3ba57</id>
<content type='text'>
snmpd_access_default_add, snmpd_access_HostName_add, and
snmpd_access_HostIP_add check if RestrictOID is `yes` or `no`
but fail to write a newline for other values of RestrictOID
(e.g., `true`, `false`) or if unset, corrupting the generated config.

Fix by using config_get_bool and restructuring to write either
a complete line or nothing. Also require RestrictedOID to be
non-empty when RestrictOID is enabled.

This is a breaking change for configs where RestrictOID is set
to a value that the old code did not match as `yes` (e.g., `true`,
`1`, `on`, `enabled`) but config_get_bool evaluates as true. In
practice, this is unlikely to affect existing installs unless a
user is unknowingly relying on unintended behavior or is deliberately
relying on the old code's non-standard boolean evaluation; this
latter case is considered unlikely by this commit's author. Configs
where RestrictOID is enabled but RestrictedOID is empty are also
affected; previously a directive with a trailing space was written,
now no directive is written.

Signed-off-by: Eric McDonald &lt;librick-openwrt@proton.me&gt;
</content>
</entry>
<entry>
<title>net-snmp: add early return when IPMask is unset</title>
<updated>2026-03-11T08:07:04Z</updated>
<author>
<name>Eric McDonald</name>
</author>
<published>2026-03-07T21:52:19Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=b6ff8c79b17baf31c3ef5253b762f2d4c42b853a'/>
<id>urn:sha1:b6ff8c79b17baf31c3ef5253b762f2d4c42b853a</id>
<content type='text'>
snmpd_access_HostIP_add would write unintended output to the
config file if the IPMask option is not specified. Add an early
return to prevent writing in that case.

This is a breaking change for configs where IPMask is unset.
Previously, an empty IPMask option would result in a malformed
directive containing a trailing slash with 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 &lt;librick-openwrt@proton.me&gt;
</content>
</entry>
<entry>
<title>net-snmp: add early return when HostIP is unset</title>
<updated>2026-03-11T08:07:04Z</updated>
<author>
<name>Eric McDonald</name>
</author>
<published>2026-03-07T21:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=1215e7e87a3e1a2082bc1e55a1ee4e642976ed1a'/>
<id>urn:sha1:1215e7e87a3e1a2082bc1e55a1ee4e642976ed1a</id>
<content type='text'>
snmpd_access_HostIP_add would write unintended output to the
config file if the HostIP option is not specified. Add an early
return to prevent writing in that case.

This is a breaking change for configs where HostIP is unset.
Previously, an empty HostIP option would result in a malformed
directive containing a bare /mask with 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 &lt;librick-openwrt@proton.me&gt;
</content>
</entry>
<entry>
<title>net-snmp: add early return when HostName is unset</title>
<updated>2026-03-11T08:07:04Z</updated>
<author>
<name>Eric McDonald</name>
</author>
<published>2026-03-07T21:50:13Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=8033cfc287257ce2507999dd8ee332655cf554d5'/>
<id>urn:sha1:8033cfc287257ce2507999dd8ee332655cf554d5</id>
<content type='text'>
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 &lt;librick-openwrt@proton.me&gt;
</content>
</entry>
<entry>
<title>net-snmp: add early return when CommunityName is unset</title>
<updated>2026-03-11T08:07:04Z</updated>
<author>
<name>Eric McDonald</name>
</author>
<published>2026-03-07T21:48:14Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=dbd293d75186eba31e99f4a6feed5193b53107fc'/>
<id>urn:sha1:dbd293d75186eba31e99f4a6feed5193b53107fc</id>
<content type='text'>
snmpd_access_default_add, snmpd_access_HostName_add, and
snmpd_access_HostIP_add would write unintended output to the
config file if the CommunityName 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 CommunityName is
unset. Previously, an empty CommunityName option would result in
a malformed directive with a double 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 &lt;librick-openwrt@proton.me&gt;
</content>
</entry>
<entry>
<title>net-snmp: add early return when Mode is unset</title>
<updated>2026-03-11T08:07:04Z</updated>
<author>
<name>Eric McDonald</name>
</author>
<published>2026-03-07T21:45:22Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=c3862ec354ab7957a54bffc8af4fe2b27b84eb13'/>
<id>urn:sha1:c3862ec354ab7957a54bffc8af4fe2b27b84eb13</id>
<content type='text'>
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 &lt;librick-openwrt@proton.me&gt;
</content>
</entry>
<entry>
<title>net-snmp: fix literal string test in snmpd_sink_add</title>
<updated>2025-12-14T21:52:39Z</updated>
<author>
<name>Eric McDonald</name>
</author>
<published>2025-12-04T17:48:16Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=93983e5b2ad7bac5e384bdd6cdcf471bbfe3eb55'/>
<id>urn:sha1:93983e5b2ad7bac5e384bdd6cdcf471bbfe3eb55</id>
<content type='text'>
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 &lt;librick-openwrt@proton.me&gt;
</content>
</entry>
<entry>
<title>net-snmp: save pid to file</title>
<updated>2025-08-11T06:13:44Z</updated>
<author>
<name>Christian Korber</name>
</author>
<published>2025-05-06T11:04:56Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=035c279d5627aa0fd44762fe48afb3dc8f402495'/>
<id>urn:sha1:035c279d5627aa0fd44762fe48afb3dc8f402495</id>
<content type='text'>
This commit saves the pid to a file in '/var/run'.

Signed-off-by: Christian Korber &lt;ck@dev.tdt.de&gt;
</content>
</entry>
<entry>
<title>net-snmp: add logging to init script</title>
<updated>2025-08-11T06:13:44Z</updated>
<author>
<name>Christian Korber</name>
</author>
<published>2025-03-25T19:53:09Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=7b616873d66248e9a999b3d4a63bd22486fa1f72'/>
<id>urn:sha1:7b616873d66248e9a999b3d4a63bd22486fa1f72</id>
<content type='text'>
To support logging in net-snmp this commit introduces this feature. There is
a new uci config section 'logging'.

The following new parameters are used:

config logging
	option log_file '/var/log/snmpd.log'
	option log_file_priority 'i'
	option log_syslog '0'
	option log_syslog_facility 'd'

Signed-off-by: Christian Korber &lt;ck@dev.tdt.de&gt;
Signed-off-by: Florian Eckert &lt;fe@dev.tdt.de&gt;
</content>
</entry>
<entry>
<title>net-snmp: modify init script for SNMPv3</title>
<updated>2025-08-11T06:13:44Z</updated>
<author>
<name>Christian Korber</name>
</author>
<published>2025-03-25T19:51:02Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=2fc221699dfa296cd13af23827498bf24dfbc97a'/>
<id>urn:sha1:2fc221699dfa296cd13af23827498bf24dfbc97a</id>
<content type='text'>
This commit adds function 'snmpd_snmpv3_add' to the init script
to support SNMPv3 config parsing.

The new uci config section has the following configuration parameters:

config v3
	option username 'John'
	option allow_write '0'
	option auth_type 'SHA|MD5'
	option auth_pass 'passphrase'
	option privacy_type 'AES|DES'
	option privacy_pass 'passphrase'
	option RestrictOID 'yes|no'
	option RestrictedOID '1.3.6.1.2.1.1.1'

This new section is only relevant if the snmp_version 'v1/v2c/v3' or 'v3'
is set in the uci section 'general'.

Signed-off-by: Christian Korber &lt;ck@dev.tdt.de&gt;
Signed-off-by: Florian Eckert &lt;fe@dev.tdt.de&gt;
</content>
</entry>
</feed>
