net-snmp won't start with setgid operation not permitted

Hello,

I updated one of my many FreeBSD boxes today and saw the update message from net-snmp dropping privileges by default now for the daemon.

I set up the permissions and rc.conf settings as described but the service won't start. All I get in the logfile is
setgid failed: Operation not permitted

I don't quite understand what I am looking at with the dump, but I believe this is the pertinent part that maybe someone can point me in the right direction.
Code:
 71619 snmpd    NAMI  "/var"
 71619 snmpd    STRU  struct stat {dev=11600531423763178715, ino=256, mode=040755, nlink=27, uid=0, gid=0, rdev=0, atime=1662077646, mtime=1720544697.934330000, ctime=1720544697.934330000, birthtime=1652343322, size=27, blksize=4096, bl
ocks=17, flags=0x800 }
 71619 snmpd    RET   fstatat 0
 71619 snmpd    CALL  fstatat(AT_FDCWD,0x17f077bb24d0,0x820a6a4e0,0)
 71619 snmpd    NAMI  "/var/net-snmp"
 71619 snmpd    STRU  struct stat {dev=11600531423763178715, ino=289388, mode=040700, nlink=2, uid=344, gid=344, rdev=0, atime=1662080775.031181000, mtime=1720545866.532454000, ctime=1720545866.532454000, birthtime=1662080775.031181000,
 size=4, blksize=4096, blocks=1, flags=0x800 }
 71619 snmpd    RET   fstatat 0
 71619 snmpd    CALL  chown(0x17f077a1d7d0,0x158,0x158)
 71619 snmpd    NAMI  "/var/net-snmp"
 71619 snmpd    RET   chown 0
 71619 snmpd    CALL  setgid(0x158)
 71619 snmpd    RET   setgid 0
 71619 snmpd    CALL  setgroups(0x1,0x820a6a640)
 71619 snmpd    RET   setgroups -1 errno 1 Operation not permitted
 71619 snmpd    CALL  issetugid
 71619 snmpd    RET   issetugid 0
 70549 snmpd    CALL  openat(AT_FDCWD,0x823f70c69,0x2<O_RDWR>)
 70549 snmpd    NAMI  "/dev/dtrace/helper"
 71619 snmpd    CALL  fstatat(AT_FDCWD,0x820a6a050,0x820a6a450,0)
 71619 snmpd    NAMI  "/usr/share/nls/C/libc.cat"
 71619 snmpd    RET   fstatat -1 errno 2 No such file or directory
 70549 snmpd    RET   openat -1 errno 2 No such file or directory
 71619 snmpd    CALL  fstatat(AT_FDCWD,0x820a6a050,0x820a6a450,0)
 71619 snmpd    NAMI  "/usr/share/nls/libc/C"
 71619 snmpd    RET   fstatat -1 errno 2 No such file or directory
 71619 snmpd    CALL  fstatat(AT_FDCWD,0x820a6a050,0x820a6a450,0)
 71619 snmpd    NAMI  "/usr/local/share/nls/C/libc.cat"
 71619 snmpd    RET   fstatat -1 errno 2 No such file or directory
 71619 snmpd    CALL  fstatat(AT_FDCWD,0x820a6a050,0x820a6a450,0)
 71619 snmpd    NAMI  "/usr/local/share/nls/libc/C"
 71619 snmpd    RET   fstatat -1 errno 2 No such file or directory
 71619 snmpd    CALL  write(0x3,0x17f077a27800,0x27)
 71619 snmpd    GIO   fd 3 wrote 39 bytes
       "setgid failed: Operation not permitted
       "
 
Same here.
The update "net-snmp upgraded: 5.9.4_4,1 -> 5.9.4_5,1" made the service not starting anymore.
I have also made the changes documented in the package
 
Back
Top