Page MenuHomeFreeBSD

Add ability to specify several community strings in snmpd.config for bsndmp(1)
ClosedPublic

Authored by ae on Jan 6 2018, 8:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 10 2024, 7:07 PM
Unknown Object (File)
Mar 10 2024, 7:07 PM
Unknown Object (File)
Mar 10 2024, 7:07 PM
Unknown Object (File)
Mar 10 2024, 7:07 PM
Unknown Object (File)
Mar 7 2024, 9:14 PM
Unknown Object (File)
Jan 12 2024, 10:05 AM
Unknown Object (File)
Jan 3 2024, 1:14 PM
Unknown Object (File)
Jan 3 2024, 1:14 PM
Subscribers

Details

Summary

Currently for bsnmpd is possible to configure only two community strings for SNMP v1/2 - one for read only access and one for write access.

begemotSnmpdCommunityString.0.1 = $(read)
# begemotSnmpdCommunityString.0.2       = $(write)
begemotSnmpdCommunityDisable    = 1

This patch allows use several different community strings with different access rights for bsnmpd. The compatibility with old config files and other snmp modules should be saved.
New field in community table is introduced: begemotSnmpdCommunityPermission. Currently it can have only two values 1 (COMM_READ, it is default value) and 2 (COMM_WRITE). When new community string is found in config file it is dynamically created. Example:

begemotSnmpdCommunityString.0.1 = "public1"
#begemotSnmpdCommunityString.0.2        = $(write)
begemotSnmpdCommunityString.0.3 = "writeAcce$s"
begemotSnmpdCommunityPermission.0.3 = 2
begemotSnmpdCommunityString.0.4 = "2public"
begemotSnmpdCommunityString.0.5 = "3pubLic"
# hide community table from SNMP agents
begemotSnmpdCommunityDisable   = 1

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ae edited the summary of this revision. (Show Details)
  • bump MIB version
  • return error code from string_save()
  • fix comment wording
  • add the check for community string uniqueness. It is ambiguous if we would have several the same community strings with different access rights.
This revision was not accepted when it landed; it landed in state Needs Review.Jan 19 2018, 8:48 AM
This revision was automatically updated to reflect the committed changes.