<feed xmlns='http://www.w3.org/2005/Atom'>
<title>monitoring-plugins/plugins/check_ssh.c, branch 3.0.0-rc3</title>
<subtitle>Monitoring Plugins
</subtitle>
<id>https://www.monitoring-plugins.org/repositories/monitoring-plugins/atom?h=3.0.0-rc3</id>
<link rel='self' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/atom?h=3.0.0-rc3'/>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/'/>
<updated>2026-02-06T11:59:58Z</updated>
<entry>
<title>Make IPv6 unconditional (#2219)</title>
<updated>2026-02-06T11:59:58Z</updated>
<author>
<name>Lorenz Kästle</name>
<email>12514511+RincewindsHat@users.noreply.github.com</email>
</author>
<published>2026-02-06T11:59:58Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=0f0865c910096c95594ac09929708e84934e46df'/>
<id>urn:sha1:0f0865c910096c95594ac09929708e84934e46df</id>
<content type='text'>
This commits removes the detection of IPv6 availability.
The IPv6 code in the plugins is used unconditionally now.</content>
</entry>
<entry>
<title>OpenBSD: pledge(2) some network-facing checks (#2225)</title>
<updated>2026-02-06T11:58:38Z</updated>
<author>
<name>Alvar</name>
<email>post@0x21.biz</email>
</author>
<published>2026-02-06T11:58:38Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=cef40299a93233f043f5b0821a9ad2c69dd612f7'/>
<id>urn:sha1:cef40299a93233f043f5b0821a9ad2c69dd612f7</id>
<content type='text'>
OpenBSD's pledge(2) system call allows the current process to
self-restrict itself, being reduced to promised pledges. For example,
unless a process says it wants to write to files, it is not allowed to
do so any longer.

This change starts by calling pledge(2) in some network-facing checks,
removing the more dangerous privileges, such as executing other files.

My initial motivation came from check_icmp, being installed as a setuid
binary and (temporarily) running with root privileges. There, the
pledge(2) calls result in check_icmp to only being allowed to interact
with the network and to setuid(2) to the calling user later on.

Afterwards, I went through my most commonly used monitoring plugins
directly interacting with the network. Thus, I continued with
pledge(2)-ing check_curl - having a huge codebase and all -,
check_ntp_time, check_smtp, check_ssh, and check_tcp.

For most of those, the changes were quite similar: start with
network-friendly promises, parse the configuration, give up file access,
and proceed with the actual check.</content>
</entry>
<entry>
<title>clang-format</title>
<updated>2025-08-01T12:35:23Z</updated>
<author>
<name>Lorenz Kästle</name>
<email>12514511+RincewindsHat@users.noreply.github.com</email>
</author>
<published>2025-08-01T12:35:23Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=2757550558d509aa5c95d8834ee76d803e110161'/>
<id>urn:sha1:2757550558d509aa5c95d8834ee76d803e110161</id>
<content type='text'>
</content>
</entry>
<entry>
<title>check_ssh: Put variable in the correct scope</title>
<updated>2025-08-01T12:35:13Z</updated>
<author>
<name>Lorenz Kästle</name>
<email>12514511+RincewindsHat@users.noreply.github.com</email>
</author>
<published>2025-08-01T12:35:13Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=a69dff15222ad43c56f0142e20d97ee51c2e6697'/>
<id>urn:sha1:a69dff15222ad43c56f0142e20d97ee51c2e6697</id>
<content type='text'>
</content>
</entry>
<entry>
<title>check_ssh: Fix format expression</title>
<updated>2025-08-01T12:34:29Z</updated>
<author>
<name>Lorenz Kästle</name>
<email>12514511+RincewindsHat@users.noreply.github.com</email>
</author>
<published>2025-08-01T12:34:29Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=3c53bf623d89650ac450be2518d17276a29247cc'/>
<id>urn:sha1:3c53bf623d89650ac450be2518d17276a29247cc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>check_ssh: fix data type to allow for error checking</title>
<updated>2025-08-01T12:34:01Z</updated>
<author>
<name>Lorenz Kästle</name>
<email>12514511+RincewindsHat@users.noreply.github.com</email>
</author>
<published>2025-08-01T12:34:01Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=69925c782bf70d267ea14a57d46b5390f5555b8f'/>
<id>urn:sha1:69925c782bf70d267ea14a57d46b5390f5555b8f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>check_ssh: Correct type on len variable</title>
<updated>2025-07-11T23:44:03Z</updated>
<author>
<name>Richard Laager</name>
<email>rlaager@wiktel.com</email>
</author>
<published>2025-07-11T23:38:42Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=1f2acfd1c6577db6e3d385614922e32ac9fad03f'/>
<id>urn:sha1:1f2acfd1c6577db6e3d385614922e32ac9fad03f</id>
<content type='text'>
strlen() returns a size_t.

Signed-off-by: Richard Laager &lt;rlaager@wiktel.com&gt;
</content>
</entry>
<entry>
<title>check_ssh: Fix buffer overflow</title>
<updated>2025-07-11T23:43:59Z</updated>
<author>
<name>Richard Laager</name>
<email>rlaager@wiktel.com</email>
</author>
<published>2025-07-11T23:19:31Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=661ecff45c5f4c41c22ef9fd4fe308100b97d6bf'/>
<id>urn:sha1:661ecff45c5f4c41c22ef9fd4fe308100b97d6bf</id>
<content type='text'>
A buffer overflow was occurring when the server responded with:
Exceeded MaxStartups\r\n

glibc would then abort() with the following output:
*** buffer overflow detected ***: terminated

It was the memset() that was overflowing the buffer.  But the memmove()
needed fixing too.

First off, there was an off-by-one error in both the memmove() and
memset().  byte_offset was already set to the start of the data _past_
the newline (i.e. len + 1).  For the memmove(), incrementing that by 1
again lost the first character of the additional output.  For the
memset(), this causes a buffer overflow.

Second, the memset() has multiple issues.  The comment claims that it
was NULing (sic "null") the "rest".  However, it has no idea how long
the "rest" is, at this point.  It was NULing BUFF_SZ - byte_offset + 1.
After fixing the off-by-one / buffer overflow, it would be NULing
BUFF_SZ - byte_offset.  But that doesn't make any sense.  The length of
the first line has no relation to the length of the second line.

For a quick-and-dirty test, add something like this just inside the
while loop:
memcpy(output,
  "Exceeded MaxStartups\r\nnext blah1 blah2 blah3 blah4\0",
  sizeof("Exceeded MaxStartups\r\nnext blah1 blah2 blah3 blah4\0"));

And, after the memmove(), add:
  printf("output='%s'\n", output);

If you fix the memset() buffer overflow, it will output:
output='ext blah1 blah2 blah3 '

As you can see, the first character is lost.

If you then fix the memmove(), it will output:
output='next blah1 blah2 blah3'

Note that this is still losing the "blah4".

After moving the memset() after byte_offset is set to the new strlen()
of output, then it works correctly:
output='next blah1 blah2 blah3 blah4'

Signed-off-by: Richard Laager &lt;rlaager@wiktel.com&gt;
</content>
</entry>
<entry>
<title>Transform output format to a global state</title>
<updated>2025-03-07T22:38:50Z</updated>
<author>
<name>Lorenz Kästle</name>
<email>12514511+RincewindsHat@users.noreply.github.com</email>
</author>
<published>2025-02-25T16:20:05Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=72fd885f4ff423d5351e3387867f2415f1ffc2d8'/>
<id>urn:sha1:72fd885f4ff423d5351e3387867f2415f1ffc2d8</id>
<content type='text'>
This commit removes the format parameter from the mp_check
object and creates a module global variable instead.
This prevents thread safe usage of different mp_check objects
which should likely not present a big problem for now.
The reason for this change is effectively the very same,
the format was lost if an exit was triggered by a signal
handler (timeout in this example).
</content>
</entry>
<entry>
<title>check_ssh.c: clang-format</title>
<updated>2025-03-07T22:38:50Z</updated>
<author>
<name>Lorenz Kästle</name>
<email>12514511+RincewindsHat@users.noreply.github.com</email>
</author>
<published>2025-02-25T12:03:27Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=2e9f9ebf7d477956c5cc1779c0fa9c89352d7ab7'/>
<id>urn:sha1:2e9f9ebf7d477956c5cc1779c0fa9c89352d7ab7</id>
<content type='text'>
</content>
</entry>
</feed>
