Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joachim Wiberg <troglobit@gmail.com>
To: buildroot@buildroot.org
Cc: Joachim Wiberg <troglobit@gmail.com>
Subject: [Buildroot] [PATCH 1/1] package/netsnmp: add option for a read-only agent
Date: Thu, 24 Sep 2026 11:56:34 +0200	[thread overview]
Message-ID: <20260924095634.1298401-1-troglobit@gmail.com> (raw)

net-snmp can be built with --enable-read-only, which removes all SET
support from the agent.  For a device that is only ever polled this is
a stronger guarantee than withholding write access through VACM, since
a mistake in the access control configuration can no longer result in a
writable agent.

The client applications are unaffected.  Default off, so existing
configurations build as before.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
 package/netsnmp/Config.in  | 12 ++++++++++++
 package/netsnmp/netsnmp.mk |  4 ++++
 2 files changed, 16 insertions(+)

diff --git a/package/netsnmp/Config.in b/package/netsnmp/Config.in
index dff0f18bee..9a740c2db2 100644
--- a/package/netsnmp/Config.in
+++ b/package/netsnmp/Config.in
@@ -43,6 +43,18 @@ config BR2_PACKAGE_NETSNMP_WITHOUT_MIB_MODULES
 	help
 	  Specify which MIB modules to exclude.
 
+config BR2_PACKAGE_NETSNMP_ENABLE_READ_ONLY
+	bool "Read-only agent"
+	depends on BR2_PACKAGE_NETSNMP_SERVER
+	help
+	  Remove all SET support from the agent, so it can be queried
+	  but never written to. Access control still needs to be
+	  configured, but a mistake there can no longer result in a
+	  writable agent.
+
+	  The client applications are unaffected, snmpset is still
+	  built when clients are enabled.
+
 config BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING
 	bool "Enable debugging code"
 	help
diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
index 55e5997734..18b5ac36e1 100644
--- a/package/netsnmp/netsnmp.mk
+++ b/package/netsnmp/netsnmp.mk
@@ -96,6 +96,10 @@ NETSNMP_CONF_OPTS += --disable-mib-loading
 NETSNMP_CONF_OPTS += --disable-mibs
 endif
 
+ifeq ($(BR2_PACKAGE_NETSNMP_ENABLE_READ_ONLY),y)
+NETSNMP_CONF_OPTS += --enable-read-only
+endif
+
 ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING),y)
 NETSNMP_CONF_OPTS += --disable-debugging
 endif
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

                 reply	other threads:[~2026-09-24  9:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260924095634.1298401-1-troglobit@gmail.com \
    --to=troglobit@gmail.com \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox