HomeFreeBSD

net-mgmt/net-snmp: Let snmpd run as a non-root user

Description

net-mgmt/net-snmp: Let snmpd run as a non-root user

  • Compile without /dev/kmem access. This requires a small patch which opens libkvm in a dummy mode which uses sysctls to implement most of its interfaces rather than /dev/kmem access. This way we can drop the dependency on /dev/kmem without rewriting existing code.
  • Add a new snmpd user. Configure snmpd to drop privileges once it's finished initialization.
  • Remove the JAIL option. Now that snmpd avoids using /dev/kmem, there's no need to have a special mode for running snmpd in jails.

The patch has been proposed upstream here:
https://sourceforge.net/p/net-snmp/mailman/net-snmp-coders/thread/ZjEwNV5BiTOQ-Adi%40nuc/#msg58766857

Approved by: zi
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D45031

Details

Provenance
markjAuthored on Apr 11 2024, 1:58 PM
Differential Revision
D45031: net-mgmt/net-snmp: Let snmpd run as a non-root user
Parents
R11:26406929ca14: net-mgmt/net-snmp: Fix the IPV6 MIB implementation
Branches
Unknown
Tags
Unknown