freebsd-dev/contrib/bsnmp/snmpd
Gleb Smirnoff 0cf0d912b7 The first part of check_priv() function, that attempts to obtain creds
from the control message, actually never worked. This means check_priv()
didn't work for local dgram sockets.

The SCM_CREDS control messages is received only in two cases:

1) If we did setsockopt(LOCAL_CREDS) on our socket, and in this case
   the message is struct sockcred.
2) If sender did supplied SCM_CREDS control message in his sendmsg()
   syscall. In this case the message is struct cmsgcred.

We can't rely on 2), so we will use 1) for dgram sockets. For stream
sockets it is more reliable to obtain accept-time credentials, since
SCM_CREDS control message is attached only on first read. Thus:

o Do setsockopt(LOCAL_CREDS) on local dgram sockets.
o Split check_priv() into check_priv_stream() and check_priv_dgram(),
  and call them from recv_stream() and recv_dgram() respectively.
o Don't provide space for SCM_CREDS control message in recv_stream().
o Provide space for SCM_CREDS control message in recv_dgram(), but there
  is no need to initialize anything in it.
o In recv_dgram() do not blindly expect that first message is SCM_CREDS,
  instead use correct search cycle through control messages.
2012-09-08 07:12:00 +00:00
..
action.c In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415). 2010-12-08 13:51:38 +00:00
BEGEMOT-MIB.txt Virgin import of bsnmpd 1.7 2004-08-06 13:38:30 +00:00
BEGEMOT-SNMPD.txt In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415). 2010-12-08 13:51:38 +00:00
bsnmpd.1 In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415). 2010-12-08 13:51:38 +00:00
config.c In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415). 2010-12-08 13:51:38 +00:00
export.c In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415). 2010-12-08 13:51:38 +00:00
FOKUS-MIB.txt Virgin import of bsnmpd 1.7 2004-08-06 13:38:30 +00:00
main.c The first part of check_priv() function, that attempts to obtain creds 2012-09-08 07:12:00 +00:00
snmpd.config Virgin import of bsnmpd 1.12 2006-02-27 16:16:18 +00:00
snmpd.h In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415). 2010-12-08 13:51:38 +00:00
snmpd.sh Virgin import of bsnmpd 1.7 2004-08-06 13:38:30 +00:00
snmpmod.3 Bring in a SNMP module that allows configuration of SNMPv3 Notification targets. 2010-12-20 17:13:14 +00:00
snmpmod.h Include sys/queue.h: snmpmod.h uses TAILQ. 2011-12-11 17:10:33 +00:00
trans_lsock.c The first part of check_priv() function, that attempts to obtain creds 2012-09-08 07:12:00 +00:00
trans_lsock.h Virgin import of bsnmpd 1.7 2004-08-06 13:38:30 +00:00
trans_udp.c In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415). 2010-12-08 13:51:38 +00:00
trans_udp.h Virgin import of bsnmpd 1.7 2004-08-06 13:38:30 +00:00
trap.c Fully initialize the stack-allocated "struct sockaddr_in sa" structure. 2012-09-07 08:58:30 +00:00
tree.def Unbreak the build by temprorarily not using include directives in 2010-12-20 22:56:50 +00:00