<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.sbin/bsnmpd/tools, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>bsnmpd: avoid warnings about too-long initializer strings</title>
<updated>2025-12-26T13:27:23+00:00</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2025-12-26T13:27:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3054e22e4524df24908d7e9379681c1ccf829b93'/>
<id>3054e22e4524df24908d7e9379681c1ccf829b93</id>
<content type='text'>
Mark `UTC` as `__non_string`, to avoid a warning from clang 21 similar
to:

    usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c:339:29: error: initializer-string for character array is too long, array size is 3 but initializer has size 4 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
    --- all_subdir_usr.sbin ---
      339 |         static const char UTC[3] = "UTC";
          |                                    ^~~~~

MFC after:	3 days
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mark `UTC` as `__non_string`, to avoid a warning from clang 21 similar
to:

    usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c:339:29: error: initializer-string for character array is too long, array size is 3 but initializer has size 4 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
    --- all_subdir_usr.sbin ---
      339 |         static const char UTC[3] = "UTC";
          |                                    ^~~~~

MFC after:	3 days
</pre>
</div>
</content>
</entry>
<entry>
<title>libbsnmp: make binding of client UNIX socket optional and configurable</title>
<updated>2025-07-25T20:10:17+00:00</updated>
<author>
<name>Gleb Smirnoff</name>
<email>glebius@FreeBSD.org</email>
</author>
<published>2025-07-25T20:10:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=777123969db5ee8eceee28d7df72b7fd7352cb85'/>
<id>777123969db5ee8eceee28d7df72b7fd7352cb85</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>bsnmpget: print SNMP library reported error on failures</title>
<updated>2025-07-17T16:00:15+00:00</updated>
<author>
<name>Gleb Smirnoff</name>
<email>glebius@FreeBSD.org</email>
</author>
<published>2025-07-17T16:00:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=44836e3277af1f272a409b8d5806c67a9dbb9cb0'/>
<id>44836e3277af1f272a409b8d5806c67a9dbb9cb0</id>
<content type='text'>
Reviewed by:		syrinx, harti
Differential Revision:	https://reviews.freebsd.org/D51073
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed by:		syrinx, harti
Differential Revision:	https://reviews.freebsd.org/D51073
</pre>
</div>
</content>
</entry>
<entry>
<title>libbsnmp: define SNMP_DEFAULT_LOCAL that matches default server config</title>
<updated>2025-07-17T15:59:44+00:00</updated>
<author>
<name>Gleb Smirnoff</name>
<email>glebius@FreeBSD.org</email>
</author>
<published>2025-07-17T15:59:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=665877ced9ea53f838f80176739a8621a61d40c6'/>
<id>665877ced9ea53f838f80176739a8621a61d40c6</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>libbsnmptools: avoid uninitialized snmptoolctx-&gt;passwd with empty password</title>
<updated>2025-01-11T05:08:02+00:00</updated>
<author>
<name>Gleb Smirnoff</name>
<email>glebius@FreeBSD.org</email>
</author>
<published>2025-01-11T05:08:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3999a860d6e899de98b1025317d2d0ef1f83255f'/>
<id>3999a860d6e899de98b1025317d2d0ef1f83255f</id>
<content type='text'>
The removed check left snmptoolctx-&gt;passwd pointer to uninitialized
memory.  Always calling strlcpy(3) would guarantee that with empty
password it will point to empty string.

Submitted by:	markj
PR:		283909
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The removed check left snmptoolctx-&gt;passwd pointer to uninitialized
memory.  Always calling strlcpy(3) would guarantee that with empty
password it will point to empty string.

Submitted by:	markj
PR:		283909
</pre>
</div>
</content>
</entry>
<entry>
<title>bsnmpwalk: Fix crash on invalid data</title>
<updated>2025-01-10T20:47:06+00:00</updated>
<author>
<name>Shteryana Shopova</name>
<email>syrinx@FreeBSD.org</email>
</author>
<published>2025-01-10T20:30:21+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f021e3573519ff192fc708cda9ca4bba264c96f7'/>
<id>f021e3573519ff192fc708cda9ca4bba264c96f7</id>
<content type='text'>
PR:		258570
Reported by:	Robert Morris &lt;rtm@lcs.mit.edu&gt;
Reviewed by:	emaste, markj
Differential Revision: https://reviews.freebsd.org/D48422
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR:		258570
Reported by:	Robert Morris &lt;rtm@lcs.mit.edu&gt;
Reviewed by:	emaste, markj
Differential Revision: https://reviews.freebsd.org/D48422
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: two-line nroff pattern</title>
<updated>2023-08-16T17:55:10+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fa9896e082a1046ff4fbc75fcba4d18d1f2efc19'/>
<id>fa9896e082a1046ff4fbc75fcba4d18d1f2efc19</id>
<content type='text'>
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-16T17:55:03+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf'/>
<id>d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-16T17:54:16+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b3e7694832e81d7a904a10f525f8797b753bf0d3'/>
<id>b3e7694832e81d7a904a10f525f8797b753bf0d3</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>libbsnmptools: Fully comment out set but unused count variable.</title>
<updated>2023-06-27T17:19:32+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2023-06-27T17:19:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=eca9714e4bf299cd704eb9e28a06a97d1bb1c301'/>
<id>eca9714e4bf299cd704eb9e28a06a97d1bb1c301</id>
<content type='text'>
These functions all end with 'return (2/* count */);'.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40670
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These functions all end with 'return (2/* count */);'.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40670
</pre>
</div>
</content>
</entry>
</feed>
