summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd
AgeCommit message (Collapse)Author
2018-12-13fix printf statements when compiled with -DDEBUG.Martijn van Duren
OK deraadt@, tb@, claudio@
2018-12-10Add a velocity sensor type (displayed as m/s)Landry Breuil
Change distance sensor type to be displayed as meters with 3 decimals instead of millimeters. ok mpi@ kettenis@
2018-12-07Be more strict in converting a netmask into a prefixlen. Make sureClaudio Jeker
the prefixlen is never bigger than 128 for inet6. OK remi@
2018-11-27Sync with ldap(1)Martijn van Duren
2018-11-20Fix when ber_free_elements is called with a NULL-value.Martijn van Duren
Found via snmpctl snmp walk 127.0.0.1 oid 1 OK claudio@
2018-11-13Remove #if'ed 0 code around a broken pledge. Due to some ioctls and sysctlsRicardo Mestre
pledge cannot be used, nevertheless since we now have unveil available we can use it to guarantee that in this particular case the snmpe process cannot access the filesystem at all, therefore close a big attack vector and achieve a great level of protection even without being able to use pledge. prodded by deraadt@
2018-11-05snmpd(8)'s main process needs to open the config file and /dev/pf both withRicardo Mestre
read permissions, but once it reaches pledge(2) just before the main loop both were already opened. Since snmpd(8) doesn't have a way to load or reload the config file, not even through SIGHUP, then rpath promise is not needed. The snmpe process cannot yet be pledged, but it doesn't need fs access so we can disable the access through unveil("/", ""); unveil(NULL, NULL); "looks right" to deraadt@
2018-11-01- odd condition/test in PF lexerAlexandr Nedvedicky
(and other lexers too) This commit rectifies earlier change: in the lex... even inside quotes, a \ followed by space or tab should expand to space or tab, and a \ followed by newline should be ignored (as a line continuation). compatible with the needs of hoststated (which has the most strict quoted string requirements), and ifstated (where one commonly does line continuations in strings). OK deraadt@, OK millert@
2018-10-10RT_TABLEID_MAX is 255, fix places that assumed that it is less than 255.Reyk Floeter
rtable 255 is a valid routing table or domain id that wasn't handled by the ip[6]_mroute code or by snmpd. The arrays in the ip[6]_mroute code where off by one and didn't allocate space for rtable 255; snmpd simply ignored rtable 255. All other places in the tree seem to handle RT_TABLEID_MAX correctly. OK florian@ benno@ henning@ deraadt@
2018-09-07replace malloc()+strlcpy() with strndup() in cmdline_symset().miko
"looks good" gilles@ halex@
2018-08-31fix fd leak in an error pathJonathan Gray
ok mpi@
2018-08-30fix double free in mib_carpgroupget() error pathJonathan Gray
ok claudio@ miko@
2018-08-13basic macro cleanup, break lines of excessive length, fix order of sectionsIngo Schwarze
2018-08-13Add more content. Tweaks from ingo. This man page is not yet hooked up to therob
build and is still a work in progress. Tweaks and comments welcome.
2018-08-12Change ber_write_elements() to return ssize_t instead of int.rob
ok claudio@
2018-08-05Remove cpath pledge(2) promise. We decided that not deleting the unix controlRicardo Mestre
sockets cause no harm and this way we close another attack surface by not allowing the daemon to create/delete any more files. While here also scramble pledge promises to their canonical form. OK florian@
2018-08-03Place a limit on the number of elements in a ber sequence/set. This preventsrob
possible stack overflow due to recursion in ber_free_elements(). ok claudio@
2018-07-31Relocate some public functions above the internal functions comment.rob
ok claudio@
2018-07-31Fix some debugging output now that ber type and encoding are unsigned int.rob
ok claudio@
2018-07-31Make ber type and encoding a unsigned int instead of unsigned long.Claudio Jeker
This way the size is the same on all archs and 32bit should be good enough. OK rob@
2018-07-24Remove defunct prototype leftover from previous code cleanup.rob
ok tb@, claudio@
2018-07-23Add missing $OpenBSD$ CVS tag.rob
2018-07-13Fix some comments referencing sockets which are not used by the ber api. Therob
api uses read and write buffers (byte streams) that are utilized by calling applications which may or may not use sockets. ok claudio@ buffer byte streams that applications then use for
2018-07-13Fix loop condition in ber.c. Discussed with claudio.rob
ok claudio@, jca@
2018-07-11Do for most running out of memory err() what was done for most runningKenneth R Westerback
out of memory log_warn(). i.e. ("%s", __func__) instead of manual function names and redundant verbiage about which wrapper detected the out of memory condition. ok henning@
2018-07-09No need to mention which memory allocation entry point failed (malloc,Kenneth R Westerback
calloc or strdup), we just need to log that we ran out of memory in a particular function. Recommended by florian@ and deraadt@ ok benno@ henning@ tb@
2018-07-09Simplify ber_read()Jeremie Courreges-Anglas
After the removal of fd-based read/writes I could have trimmed the code further. - no socket-based reads so ber_read() doesn't need to loop until it gets the desired amount of data - return either the requested amount of data or -1/ECANCELED, the caller shouldn't have to handle partial reads itself - inline ber_readbuf() into ber_read() ok rob@ claudio@ tb@
2018-07-08Be consistent in warn() and log_warn() usage whenKenneth R Westerback
running out of memory. Next step, be correct *and* consistent. ok dennis@ tb@ benno@ schwarze@
2018-07-04More whitespace.rob
2018-07-04Cleanup some whitespace.rob
2018-07-04Relocate the update of br_offs from ber_read() to ber_readbuf() so ber_getc()rob
can call ber_readbuf() in all cases. This resolves a problem previously encountered with SNMPv3 authentication, simplifies the code, and completes a full synchronization of all ber instances. Proposed by claudio@. Problematic use case in snmpd tested by sthen@ and me. ldap(s) appear happy as well. looks good to claudio@
2018-07-01s/constructive/constructed in DPRINTF output.rob
2018-06-30revert ber.c r1.34, this break SNMPv3 authenticationStuart Henderson
2018-06-29tweak previous;Jason McIntyre
2018-06-29Add ber_free_element() to snmpd instance, reducing the diff with ldap, ldapd,rob
and ypldap. This function is not called by snmpd. This is the penultimate commit prior to full sync between these four consumers of ber.
2018-06-29Synchronize ber.c and ber.h across ldap, ldapd, and ypldap, and reduce diffrob
with snmpd. More tweaks to come once things are fully synchronized. Feedback from claudio and Robert Klein. Ok claudio@
2018-06-27Synchronize correct processing of BER_TYPE_EOC. Fixes support for empty LDAProb
passwords. A similar fix was applied to snmpd in 2010 (rev 1.23). Pointers from Reyk. Ok claudio@
2018-06-20Add bsws and arcaTrust PENsReyk Floeter
2018-06-18remove the SECTIONS header, since a one line DESCRIPTION is a bit silly;Jason McIntyre
use a more general text for the sections, and avoid the catchup issue that was trying to document how many there were; ok benno rob
2018-06-17Bring snmpd agentx.c closer in line with relayd.rob
ok benno@, "sure" deraadt@
2018-06-11Fix an off-by-one line count when using include statements.denis
Thanks to otto@ for the initial diff. OK benno@
2018-06-04Fix file descriptor leak.Gerhard Roth
Patch submitted by Nan Xiao, ok tb@ sthen@ millert@ deraadt@ jca@
2018-05-30Use new SIOCGIFGLIST to provide carpGroupTable, showing "demote" valuesStuart Henderson
for interface groups on the system. From Jan Klemkow.
2018-05-25Use a cache for process information to speed up snmp walks.Gerhard Roth
ok jca@ claudio@
2018-05-15The snmpd.conf file is divided into four (not three) main sections.Reyk Floeter
From Steve Arntzen
2018-05-09As required by IF-MIB, cap ifSpeed at UINT32_MAX; the value is a GAUGE32 soStuart Henderson
values above this can't be represented and ifHighSpeed must be used instead. Problem reported by Arnaud BRAND, ok mpi
2018-04-26Plug leak in error case of the common 'varset' implementations.Kenneth R Westerback
ok benno@
2018-04-15Add TCP support to snmpd.Marco Pfatschbacher
This implements RFC 3430, with the exception of processing multiple incoming requests in parallel (Section 2.1). This required too much code and is optional anyway. Initial review by reyk@, very thorough reviews by jca@. Thanks! OK jca@, gerhard@
2018-02-14whitespacerob
2018-02-08Kill ber.c support for direct fd read/writesJeremie Courreges-Anglas
This mechanism is already unused and annotated with lots of XXX's, no need to keep it around. ok claudio@