History log of /freebsd-current/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
Revision Date Author Comments
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# eca9714e 27-Jun-2023 John Baldwin <jhb@FreeBSD.org>

libbsnmptools: Fully comment out set but unused count variable.

These functions all end with 'return (2/* count */);'.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40670


# 8b223768 01-Jun-2023 Elyes Haouas <ehaouas@noos.fr>

bsnmpd/tools/libbsnmptools: Fix typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/653


# dca51295 05-Aug-2020 Eugene Grosbein <eugen@FreeBSD.org>

bsnmptools: make it print protocol errors to stderr instead of stdout

Reviewed by: syrinx, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25911


# b85e09db 03-Jan-2017 Enji Cooper <ngie@FreeBSD.org>

Fix logical inversion when checking result from calloc
in snmp_output_err_resp(..)

X-MFC with: r310987
MFC after: 3 days
Reported by: Coverity
CID: 1368195


# 86b3c169 31-Dec-2016 Enji Cooper <ngie@FreeBSD.org>

snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not
on the stack

Some of the callers try to determine whether or not `object` is valid by
testing the value for NULL, which will never be true if it's a stack value,
so in order to be clear and correct down the call stack, use a heap
allocated object.

This also addresses a Coverity issue by initializing all of `object` via
calloc

MFC after: 1 week
Reported by: Coverity
CID: 1006392


# 09fe010e 31-Dec-2016 Enji Cooper <ngie@FreeBSD.org>

snmp_output_resp: style(9): sort variables by alignment

MFC after: 3 days


# 2229fa01 27-Dec-2016 Enji Cooper <ngie@FreeBSD.org>

style(9) fixes: clean up leading whitespace

MFC after: 3 days


# e1d581b2 27-Dec-2016 Enji Cooper <ngie@FreeBSD.org>

style(9): clean up trailing whitespace

MFC after: 3 weeks


# 7c933da6 24-Dec-2016 Enji Cooper <ngie@FreeBSD.org>

Warning message cleanup

- Use warn instead of warnx + strerror(errno)
- Remove unnecessary trailing newline from a warnx call
- Add missing spaces following "," in syslog and warn* calls

MFC after: 2 weeks


# 229bb4da 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Correct function names that failed in error messages

It should be calloc/strdup, not malloc

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division


# 25014372 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Fix up both r299764 and r299770

nitems was wrong too, as it was being tested against a pointer instead of a buffer on
the stack.

Since the old code was just doing malloc, then strlcpy'ing the contents of the source
buffer into the destination buffer, replace it all with a call to strdup..

Reported by: bde
MFC after: 1 week
X-MFC with: r299764, r299770
Supersized Duncecap to: ngie
Sponsored by: EMC / Isilon Storage Division


# 54811dda 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Fix up r299764

I meant to use nitems, not sizeof(..) with the destination buffer. Using sizeof(..)
on a pointer will always truncate the output in the destination buffer incorrectly

Pointyhat to: ngie
MFC after: 1 week
X-MFC with: r299764
Sponsored by: EMC / Isilon Storage Division


# 715e3b39 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Fix logically dead code pointed out by clang/Coverity

parse_context, parse_user_security: test for validity of results from
parse_ascii(..) with by casting to int32_t and comparing to -1; comparing
unsigned types to negative values will always be false.

Reported by: clang, Coverity
CID: 1011432, 1011433
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division


# 81910adf 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Fix theoretical buffer overflow issues in snmp_oid2asn_oid

Increase the size of `string` by 1 to account for the '\0' terminator. In the event
that `str` doesn't contain any non-alpha chars, i would be set to MAXSTR, and
the subsequent strlcpy call would overflow by a character.

Remove unnecessary `string[i] = '\0'` -- this is already handled by strlcpy.

MFC after: 1 week
Reported by: clang
Sponsored by: EMC / Isilon Storage Division


# 78a780e3 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Use the size of the destination buffer, not the source buffer.

Technically this is a no-op, but mute the clang warning in case the malloc call
above for fstring ever changes in the future

Reported by: clang
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division


# 444991f1 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Mark snmptoolctx unused in parse_authentication(..), parse_privacy(..),
parse_context(..), and parse_user_security(..).

MFC after: 1 week
Reported by: clang, gcc
Sponsored by: EMC / Isilon Storage Division


# 4a8c12cd 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

parse_ascii: make count size_t to mute a -Wsign-compare issue

count is always unsigned.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division


# 9a3ebeef 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Sort variables in parse_ascii(..) per style(9)

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division


# 031987d9 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Use calloc instead of memset(.., 0, ..) + malloc

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division


# 7a7c07ef 13-May-2016 Don Lewis <truckman@FreeBSD.org>

Properly compute the size argument to pass to malloc().

Reported by: Coverity
CID: 1198856
MFC after: 1 week


# 9899399c 22-Apr-2016 Enji Cooper <ngie@FreeBSD.org>

Don't try to free `string` (stack allocated char[])

Fix minor style with warnx call while in the neighborhood

MFC after: 1 week
CID: 1009683
Reported by: Coverity, gcc 5.x
Sponsored by: EMC / Isilon Storage Division


# 646a7fea 26-Jan-2013 Pedro F. Giffuni <pfg@FreeBSD.org>

Clean some 'svn:executable' properties in the tree.

Submitted by: Christoph Mallon
MFC after: 3 days


# b9288caa 10-Jan-2012 Shteryana Shopova <syrinx@FreeBSD.org>

Implement an option to execute SNMP walks using GETBULK requests in bsnmpwalk(1)
retrieving multiple values with a Single PDU.

Reviewed by: philip@
Tested by: tsanand129 (at) gmail (dot) com


# 3df5ecac 30-Dec-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Spelling fixes for usr.sbin/


# a7398723 08-Dec-2010 Shteryana Shopova <syrinx@FreeBSD.org>

Add bsnmpd(1)'s SNMP client tools (including SNMPv3 support) to the base system.

Sponsored by: The FreeBSD Foundation (the SNMPv3 bits), Google Summer of Code 2005
Reviewed by: philip@ (mostly), bz@ (earlier version based on p4 ch124545)
Approved by: philip@