| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
Modifying and using a variable without an intervening sequence point
is undefined behaviour, which causes an error in the GCC build.
Reviewed by: harti, emaste
Differential Revision: https://reviews.freebsd.org/D51576
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per documentation snmp_parse_server() has all 4 components optional. We
want inputs like "udp::", "udp6::", "stream::" work with local default
sockets and even degenerate case of "" shall end with defaults instead of
a failure.
While here make the parser more robust. Make all parser helpers to behave
the same way: on successful return they are responsible to update both
start & end of matched substring and return next characater to parse.
This eliminates special handling of IPv6 and port parser that used to need
to skip a character, and thus eliminates unchecked step forward in
snmp_parse_server() itself. Additionally:
- use strchr(3) instead of own cycle
- INET_ADDRSTRLEN includes space for NUL character
- INET6_ADDRSTRLEN includes both the scope and NUL character
- prefer sizeof() comparison instead of preprocessor define repetitive use
Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51072
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this change snmp_open(3) would always bind(2) client socket to a
random "/tmp/snmpXXXXXXXXXXXXXX" name. However, this binding is not
required for SOCK_STREAM transport. Also, any attempt to specify a
different name would fail, as open_client_local() would blindly rewrite
the name to the default.
Make this binding optional. If application had initialized
snmp_client.local_path, then try to bind to the specified pathname,
otherwise perform the random name binding only if we are in the
SOCK_DGRAM mode.
While here change snmp_client.local_path size to SUNPATHLEN, so that any
legitimate local socket name can be used. This requires library version
bump.
Note that this code has been broken by 81e0e7b9e36d for three years, thus
it is known not to be widely used.
Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51070
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The default /etc/snmpd.config we install for decades has:
begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4
However, libbsnmp internally used DEFAULT_LOCAL set to
"/var/run/snmp.sock" (note missing "d") to fill server pathname in case if
API user didn't provide one. This results with default server config
never working with an application that uses default initializer. The
libbsnmptools has a workaround for that, it defines internally
SNMP_DEFAULT_LOCAL that matches /etc/snmpd.config.
Bring this all to an order:
- Make a public define SNMP_DEFAULT_LOCAL in libbsnmp.
- Point it to what /etc/snmpd.config has in.
- Remove workaround from libbsnmptools.
Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51071
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Revert "bsnmp: Use mkstemp when creating clients local socket"
The use of mktemp() was intentional here. We don't want a regular file to
be created. If created, it guarantees that following bind(2) would always
fail with EADDRINUSE and thus open_client_local() always fails.
This reverts commit 81e0e7b9e36d6a25b3af6482811318e085537d2f.
Reviewed by: rew, harti
Differential Revision: https://reviews.freebsd.org/D51031
|
| |
|
|
| |
PR: 283909
|
| | |
|
| |
|
|
|
|
|
|
| |
Reviewed by: harti, rew
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #72
Differential Revision: https://reviews.freebsd.org/D34550
|
| |
|
|
|
|
| |
- s/responce/response/
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 89e3d5671ba13dceca272d5b159c9bd805f3f504.
As pointed out, there are several problems with that commit:
1. The new semantics, while useful for clients where multiple
threads use separate contexts, breaks clients which correctly
share a single one
2. Change in semantics would require a library version bump
3. It doesn't build with GCC
|
| |
|
|
|
|
|
| |
Reviewed By: harti
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D27336
|
| |\
| |
| |
| | |
Notes:
svn path=/head/; revision=359512
|
| | |
| |
| |
| | |
Notes:
svn path=/vendor/bsnmp/dist/; revision=186357
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Summary:
The ?: operator has a lower precedence than == and &&, so the result will always
be recorded as true. Found by gcc8.
Reviewed by: ngie, ae
Differential Revision: https://reviews.freebsd.org/D22427
Notes:
svn path=/head/; revision=354834
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
admbugs: 780
Submitted by: Guido Vranken, bz
Reported by: Guido Vranken
Security: CVE-2019-5610
Notes:
svn path=/head/; revision=350635
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
bsnmpclient(3).
snmp_parse_server() function accepts string where some fields can be
omitted: [trans::][community@][server][:port]
"trans" field can be "udp", "udp6", "dgram" and "stream".
"community" can be empty string, if it is omitted, the default value
will be used. For read_community it is "public", for write_comminity
it is "private". "server" field can be hostname, IPv4 address or IPv6
address. IPv6 address should be specified in brackets "[]".
If port is omitted, the default value "snmp" will be used for "udp"
and "udp6" transports. So, now for bsnmpget(1) and bsnmwalk(1) it is
not required to specify all fields in argument of '-s' option. E.g.
# bsnmpget -s 127.1 sysName.0
# bsnmpget -s "udp::127.1" sysName.0
# bsnmpget -s "udp::public@127.1" sysName.0
# bsnmpget -s "udp::public@127.1:161" sysName.0
# bsnmpget -s "udp::[::1]" sysName.0
# bsnmpget -s "udp6::[::1]" sysName.0
# bsnmpget -s "[fe80::1%lo0]" sysName.0
PR: 236664
Reported by: olivier
MFC after: 1 month
Notes:
svn path=/head/; revision=345843
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds a new table begemotSnmpdTransInetTable that uses the
InetAddressType textual convention and can be used to create listening
ports for IPv4, IPv6, zoned IPv6 and based on DNS names. It also supports
future extension beyond UDP by adding a protocol identifier to the table
index. In order to support this gensnmptree had to be modified.
Submitted by: harti
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16654
Notes:
svn path=/head/; revision=345797
|
| | |
| |
| |
| | |
Notes:
svn path=/projects/openssl111/; revision=338769
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For developers gensnmptree can now generate functions for enums to convert
between enums and strings and to check the validity of a value.
The sources in FreeBSD are now in sync with the upstream which allows to
bring in IPv6 modifications.
Notes:
svn path=/head/; revision=335885
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
snmp_open(..)
open_client_* returns -1 on failure; 0 on success. Ensure that the return value is
0 -- otherwise exit snmp_open(..).
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=315642
|
| | |
| |
| |
| |
| |
| |
| |
| | |
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=315641
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
MFC after: 1 week
Reported by: Coverity
CID: 1017276
Notes:
svn path=/head/; revision=311390
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This doesn't fix the issue noted in the PR, but at the very least it
cleans up the error so it looks a bit more sane, and in the event
that bsnmp did wander off into the weeds, the likelihood of it
crashing with more sensible output is greater, in my opinion
MFC counter set high so I have enough time to resolve the real
underlying bug in bsnmpwalk
MFC after: 1 month
PR: 215721
Notes:
svn path=/head/; revision=311263
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 3 days
Notes:
svn path=/head/; revision=311003
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 3 days
Notes:
svn path=/head/; revision=311001
|
| | |
| |
| |
| |
| |
| |
| |
| | |
MFC after: 3 days
Reported by: igor
Notes:
svn path=/head/; revision=311000
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
and snmp_client_set_port. Add them to the NAME section
MFC after: 3 days
Notes:
svn path=/head/; revision=310999
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Call snmp_pdu_free on req and resp when done with the objects
- Call snmp_pdu_free on req before calling snmp_pdu_create on it
again
MFC after: 1 week
Notes:
svn path=/head/; revision=310988
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
MFC after: 1 week
X-MFC with: r310931
Pointyhat to: ngie
Notes:
svn path=/head/; revision=310942
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This simplifies the code and mutes a Coverity warning about sc->cport being
improperly allocated
Reported by: Coverity
CID: 1018247
MFC after: 1 week
Notes:
svn path=/head/; revision=310931
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that
could happen if a pdu was reused after calling the function, and
as both stack and heap allocation types are used in contrib/bsnmp
and usr.sbin/bsnmpd.
snmp_value_free: NULL out value->v.octetstring.octets after calling
free on it to prevent a double-free from occurring.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=310729
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 3 days
Notes:
svn path=/head/; revision=310662
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 3 days
Notes:
svn path=/head/; revision=310660
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=310648
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Use inet_pton with AF_INET instead of doing longhand with sscanf.
- Use gethostbyname2 with AF_INET to ensure that the hostname isn't
accidentally parsed with another address family, e.g. AF_INET6.
NB: IpAddress per RFC-2578 is IPv4 only. Work is in progress to add
the InetAddress type and friends documented in RFC-4001 and
elsewhere (which supports IPv4, IPv6, and more).
MFC after: 2 weeks
Notes:
svn path=/head/; revision=310501
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Trailing whitespace cleanup
- Sort variables in snmp_dialog(..) by alignment
No functional change
MFC after: 1 week
Notes:
svn path=/head/; revision=310500
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
No functional change
MFC after: 3 days
Notes:
svn path=/head/; revision=310499
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix variable type alignment in snmp_dialog(..)
MFC after: 1 week
Notes:
svn path=/head/; revision=310202
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
requirements of RFC 3414 section 4.
PR: 174974
Submitted by: pguyot@kallisys.net
Reported by: several people
Reviewed by: bz@
Notes:
svn path=/head/; revision=308490
|
| | |
| |
| |
| |
| |
| |
| | |
Reviewed by: bz@
Notes:
svn path=/head/; revision=307882
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
snmp_passwd_to_keys
MFC after: 1 week
Reported by: Beeblebrox <zaphod@berentweb.com>
Notes:
svn path=/head/; revision=276319
|
| | |
| |
| |
| |
| |
| |
| |
| | |
second subid to be less than 40, not the first when the first
subid is 0 or 1.
Notes:
svn path=/head/; revision=260986
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reported by: dinoex
Submitted by: harti
Security: FreeBSD-SA-14:01.bsnmpd
Security: CVE-2014-1452
Notes:
svn path=/head/; revision=260636
|
| | |
| |
| |
| | |
Notes:
svn path=/head/; revision=256680
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
auth/encryption.
Reported by: harti@
Notes:
svn path=/head/; revision=256678
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Submitted by: Christoph Mallon
MFC after: 3 days
Notes:
svn path=/head/; revision=245952
|
| | |
| |
| |
| | |
Notes:
svn path=/head/; revision=237194
|
| | |
| |
| |
| | |
Notes:
svn path=/head/; revision=237193
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Sponsored by: The FreeBSD Foundation
Reviewed by: philip
Approved by: philip
Notes:
svn path=/head/; revision=216594
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
unsed parameters.
Sponsored by: The FreeBSD Foundation
Reviewed by: philip@
Notes:
svn path=/head/; revision=216482
|