Commit graph

64 commits

Author SHA1 Message Date
Lorenz Kästle
802e46f8ea Run clang-format again 2025-09-15 12:59:37 +02:00
Lorenz Kästle
d3f22c96bb check_dhcp: little fix to output 2025-06-23 12:09:58 +02:00
Lorenz Kästle
0453d6d1e2 Refactor check_dhcp 2025-06-23 12:09:58 +02:00
Lorenz Kästle
a0d3493f9d check_dhcp: clang-format 2025-06-23 12:09:58 +02:00
RincewindsHat
cd4d59fbd4 check_dhcp: Declare internal variables static 2024-10-15 16:09:09 +02:00
RincewindsHat
a0e2266c75 check_dhcp: Update copyright 2024-10-15 16:01:27 +02:00
RincewindsHat
3934457c2a check_dhcp: clang-format 2024-10-15 16:00:07 +02:00
RincewindsHat
8fe3fc7829 check_dhcp: Make implicit conversion explicit to dismiss warning 2023-12-29 00:59:58 +01:00
RincewindsHat
79e2f52094 Fix for -Wunused-but-set-variable 2023-10-16 00:59:30 +02:00
Lorenz Kästle
103821efeb Make some booleans nicer 2023-10-03 12:25:48 +02:00
Lorenz Kästle
ec9ed25265 Some code formatting 2023-10-03 12:20:24 +02:00
Lorenz Kästle
2723d48d84 New variable is actually a boolean 2023-10-03 12:14:06 +02:00
Patrick Cervicek
65237fd7a5 check_dhcp.c merged patch from #752
- added dhcp rogue detection
	contributed by Patrick Cervicek (patrick AT cervicek.de)
  - closes #752
2023-10-03 12:13:23 +02:00
RincewindsHat
9f9f5fd9b2 Update copyright 2023-10-01 14:05:59 +02:00
RincewindsHat
f2ed728823 Remove trailing lines 2023-10-01 14:03:44 +02:00
RincewindsHat
11487d161c Comment some endifs to make comprehension easier 2023-10-01 14:03:34 +02:00
RincewindsHat
1aaa238503 Use real booleans 2023-10-01 13:59:00 +02:00
RincewindsHat
0751063918 Homogenize whitespace usage 2023-10-01 13:55:22 +02:00
RincewindsHat
e695a81b13 Remove unnecessary type defines 2023-10-01 13:40:50 +02:00
waja
265a7c0ed8
Merge branch 'master' into compiler_warning_part_2 2023-06-28 16:39:27 +02:00
RincewindsHat
907b933a87 Fixes for -Wunused-parameters 2023-04-18 00:20:12 +02:00
RincewindsHat
6c78f0b5ea Fixes for -Wunused
* lib/utils_base.c
* plugins/check_curl.c
* plugins-root/check_dhcp.c
   Removed a line which theoretically can not do anything, but there was
   comment which indicated something else. Still trying this though.
2023-04-18 00:13:24 +02:00
Vadim Zhukov
60ec4d2901 Use size_t instead of int when calling sysctl(3).
Otherwise, it writes sizeof(size_t) bytes to &oldlen, smashing the stack.
2020-01-21 20:40:30 +01:00
Harald Koch
9dd09ec331 properly remove MSG_PEEK in check_dhcp.c. Fixes #1450. 2016-12-07 13:11:40 -05:00
Holger Weiss
8672529b37 check_dhcp: Make xid a bit more random
Don't just use the current time(2) to seed the PRNG that generates the
xid.  A DHCP server might be checked multiple times per second.
2016-09-16 09:43:04 +02:00
Holger Weiss
99f5be2992 check_dhcp: Don't peek before reading response
Omit a recvfrom(3) call which has the MSG_PEEK flag set and should have
no effect at all.  According to a comment in the code, this call was
meant to be a workaround to an opaque issue.  If anyone runs into that
issue, we should fix it properly instead.
2016-09-14 11:57:31 +02:00
Holger Weiss
37928b52a5 Merge branch 'maint'
* maint:
  sslutils: Remove superfluous parenthesis for sslv3 function too
  sslutils: remove superfluous parenthesis
  check_snmp: modified tests
  check_snmp.c: switched DEFAULT_TIMEOUT to DEFAULT_SOCKET_TIMEOUT (provided by utils.h), already used by help description, see issue #1318
  install snmpd on travis tests
  enable libtab on travis builds
  add perl snmp to travis dependencies
  NEWS: Mention check_ups performance data fix
  Fix incorrect performance data thresholds
  check_dhcp: Fix option parsing
  Fixes segfaults when running via monitoring worker (off-by-one)
  travis: fix http test host
  sslutils: Check if OpenSSL supports SSLv3.

Conflicts:
	NEWS
	plugins/sslutils.c
2015-10-08 12:52:10 +02:00
Sven Nierlein
bebf1cd050 use unknown exit code for help/version in plugins-root as well
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-04 19:24:30 +02:00
Holger Weiss
466cb79e52 check_dhcp: Fix option parsing
The call_getopt() function didn't always return the correct number of
processed arguments.  However, since check_dhcp doesn't support
non-option arguments, the caller doesn't need this number anyway.

Closes #1345.
2015-10-02 12:18:13 +02:00
Jan Wagner
6a939fa1ba Fixes segfaults when running via monitoring worker
(off-by-one)

Grabed from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198318
2015-10-02 10:32:00 +02:00
Jan Wagner
ba21e26443 check_icmp/check_dhcp: disable check, if we are root
As it is possible to use capabilities(7) on linux or solaris
privileges for example, it is not necessary in all cases to
have those binaries making use of setuid.
2014-07-06 13:29:24 +02:00
Spenser Reinhardt
e7e6edb2f8 plugins-root/check_dhcp.c - array out of bounds
Coverity 66488 - offer_packet->options has a max size of 312. It was being used in a loop verifying less than 311, but increasing by 2 per loop, causing a possible array index out of bounds. Changed to checking less than max length - 1. - SR
2014-06-28 18:22:04 +02:00
Holger Weiss
c3e756a855 Capitalize "Monitoring" when it's the first word 2014-01-20 03:12:50 +01:00
Monitoring Plugins Development Team
63734f52ab Project rename initial commit.
This is an initial take at renaming the project to Monitoring Plugins.
It's not expected to be fully complete, and it is expected to break
things (The perl module for instance). More testing will be required
before this goes mainline.
2014-01-19 14:18:47 -05:00
Sven Nierlein
6e9d16809e check_dhcp: fix mac address and interface number detection on solaris
newer (or x86) solaris implementations have interface names like e1000g0
which includes numbers. So we reverse the interface number detection to
get the last number, instead of the first number.
2013-09-17 19:56:55 +02:00
Holger Weiss
4d52762732 check_dhcp: Don't misinterpret the "siaddr" field
RFC 2131 (2.) says: "DHCP clarifies the interpretation of the 'siaddr'
field as the address of the server to use in the next step of the
client's bootstrap process."  So, we shouldn't interpret this field as
the DHCP server's own address.  (#3503921 - Jason Ellison)
2012-06-14 00:39:55 +02:00
Holger Weiss
f091d59e0f check_dhcp: Fix handling of "pad" options
Don't let "pad" options[*] terminate the parsing of DHCP options.  This
bug was triggered by using check_dhcp against Windows 2003 DHCP servers
(see #3503921).

[*] Cf. RFC 2132, 3.1.
2012-06-13 12:36:42 +02:00
Thomas Guyot-Sionnest
eaf3cb27f4 Add newline after "Usage:" in --help 2010-04-22 08:57:14 -04:00
Thomas Guyot-Sionnest
884aee0667 Standardize the extra-opts notes 2010-04-21 23:29:18 -04:00
Thomas Guyot-Sionnest
25d1ee331d Fix translations when extra-opts aren't enabled
Bug #2832884 reported problem with translations outputting pot file
headers. This is caused by "" matching the header of the translation
files.

This patch moves gettext macros inside utils macros and update some
french translations.
2010-04-14 08:33:06 -04:00
Thomas Guyot-Sionnest
6fbd14fea5 Removing CVS/SVN tags and replacing with git-based versioning
For contrib/, full tags have been imported from subversion


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-23 05:38:47 +00:00
Thomas Guyot-Sionnest
caa8bd6423 Bulk EOL cleanup
$ git diff --ignore-space-change|diffstat
 0 files changed


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2087 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-19 06:45:18 +00:00
Holger Weiss
830f3cc38a Don't try to set the "SO_BROADCAST" socket option for unicast requests.
(Also, removed the unused "DHCP_UNICAST_FLAG" macro.)


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2018 f882894a-f735-0410-b71e-b25c423dba1c
2008-07-06 12:57:11 +00:00
Thomas Guyot-Sionnest
44f8455b2c Added support for --extra-opts in all C plugins (disabled by default, see configure --help)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1991 f882894a-f735-0410-b71e-b25c423dba1c
2008-05-07 10:02:42 +00:00
Thomas Guyot-Sionnest
767bf9a0f2 --help output cleanup (plus removal of spaces on blank lines)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1985 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-29 09:01:31 +00:00
Thomas Guyot-Sionnest
edf361db3e Bump plugins-root/ to GPLv3
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1920 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-31 11:52:45 +00:00
Ton Voon
cf0dee616a Automatically update website with --help output. Cosmetic
fixes for some help output


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1810 f882894a-f735-0410-b71e-b25c423dba1c
2007-10-25 20:43:04 +00:00
Holger Weiss
0a02314e8d The "--serverip" and "--requestedip" options now accept host names, too.
This doesn't quite fit the option names and so far I haven't changed the
"--help" output which currently only talks about IP addresses.  However,
I don't see why resolving host names should not be supported.

Also note that for the moment, I added a quick'n'dirty resolve_host()
function which should really go into netutils.c.  I just wanted to think
about its interface a bit more before providing such a function globally.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1766 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26 17:32:37 +00:00
Holger Weiss
ee33124028 New "-m, --mac" option which allows for specifying the MAC address to
use in the DHCP request.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1765 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26 12:38:53 +00:00
Holger Weiss
6f60c0ac81 Make sure strncpy(3)d buffers are nul-terminated.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1764 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26 00:46:42 +00:00