Commit graph

6748 commits

Author SHA1 Message Date
Yonas Habteab
afd22622fb Process: Remove dead code 2026-01-26 16:39:10 +01:00
Yonas Habteab
5e62e766a8 Avoid copying local variables if possible 2026-01-26 16:03:03 +01:00
Yonas Habteab
be1c1319e6 IcingaDB: Remove duplicated code & use *.empty() to check for emptiness 2026-01-26 16:03:03 +01:00
Yonas Habteab
014ff59a63 Reserve vector capacity where applicable & declare variables only when they're to be used 2026-01-26 16:03:03 +01:00
Alexander Aleksandrovič Klimov
363a051e18
Merge pull request #9728 from Icinga/silence-compiler-warnings-about-unused-parameters
Silence compiler warnings about unused parameters
2026-01-23 16:40:54 +01:00
Alexander A. Klimov
4ba46f9eb2 Silence compiler warnings about unused parameters
Every of these parameters exists for a reason.
The best we can do is to convince the compiler.
2026-01-23 13:31:01 +01:00
Alexander Aleksandrovič Klimov
92d9f64eb0
Merge pull request #10693 from Icinga/AddDowntime-origin
`Downtime::AddDowntime()`: remove unused parameter `const MessageOrigin::Ptr& origin`
2026-01-23 13:22:55 +01:00
Alexander A. Klimov
92b6034504 Downtime::AddDowntime(): remove unused parameter const MessageOrigin::Ptr& origin 2026-01-23 10:41:18 +01:00
Johannes Schmidt
1505f09ed6 Refactor HttpMessage into generalized templated types
This adds generalized IncomingHttpMessage and OutgoingHttpMessage templates
that support different types of streams (via a std::variant) and can both
be used for either requests or responses.

The tacked on metadata from the old HttpRequest and server connection from
the old HttpServerConnection have been moved to HttpApi(Request|Response)
classes that derive from the above generalized message types.
2026-01-22 17:20:32 +01:00
Johannes Schmidt
a0f603f608 Update names of HttpRequest and HttpResponse 2026-01-22 12:41:21 +01:00
Johannes Schmidt
f493f2bbca Fix a race condition in NotificationComponent
Fix the race condition described in the previous commit by locking the
checkable earlier in NotificationTimerHandler().
2026-01-13 10:55:29 +01:00
Egor-OSSRevival
0d32ae3159
docs: Remove 'queue' parameter requirement from event stream document… (#10495)
Some checks failed
Container Image / Container Image (push) Has been cancelled
Linux / alpine:bash (push) Has been cancelled
Linux / amazonlinux:2 (push) Has been cancelled
Linux / amazonlinux:2023 (push) Has been cancelled
Linux / debian:11 (linux/386) (push) Has been cancelled
Linux / debian:11 (push) Has been cancelled
Linux / debian:12 (linux/386) (push) Has been cancelled
Linux / debian:12 (push) Has been cancelled
Linux / debian:13 (push) Has been cancelled
Linux / fedora:41 (push) Has been cancelled
Linux / fedora:42 (push) Has been cancelled
Linux / fedora:43 (push) Has been cancelled
Linux / opensuse/leap:15.6 (push) Has been cancelled
Linux / opensuse/leap:16.0 (push) Has been cancelled
Linux / registry.suse.com/bci/bci-base:16.0 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.6 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.7 (push) Has been cancelled
Linux / rockylinux/rockylinux:10 (push) Has been cancelled
Linux / rockylinux:8 (push) Has been cancelled
Linux / rockylinux:9 (push) Has been cancelled
Linux / ubuntu:22.04 (push) Has been cancelled
Linux / ubuntu:24.04 (push) Has been cancelled
Linux / ubuntu:25.04 (push) Has been cancelled
Linux / ubuntu:25.10 (push) Has been cancelled
Windows / Windows (push) Has been cancelled
* docs: Remove 'queue' parameter requirement from event stream documentation

* Update AUTHORS
2026-01-07 14:51:26 +01:00
Julian Brost
dc09713ac4
Merge pull request #10350 from Icinga/unittest-certificate-verification
Some checks are pending
Container Image / Container Image (push) Waiting to run
Linux / alpine:bash (push) Waiting to run
Linux / amazonlinux:2 (push) Waiting to run
Linux / amazonlinux:2023 (push) Waiting to run
Linux / debian:11 (linux/386) (push) Waiting to run
Linux / debian:11 (push) Waiting to run
Linux / debian:12 (linux/386) (push) Waiting to run
Linux / debian:12 (push) Waiting to run
Linux / debian:13 (push) Waiting to run
Linux / fedora:41 (push) Waiting to run
Linux / fedora:42 (push) Waiting to run
Linux / fedora:43 (push) Waiting to run
Linux / opensuse/leap:15.6 (push) Waiting to run
Linux / opensuse/leap:16.0 (push) Waiting to run
Linux / registry.suse.com/bci/bci-base:16.0 (push) Waiting to run
Linux / registry.suse.com/suse/sle15:15.6 (push) Waiting to run
Linux / registry.suse.com/suse/sle15:15.7 (push) Waiting to run
Linux / rockylinux/rockylinux:10 (push) Waiting to run
Linux / rockylinux:8 (push) Waiting to run
Linux / rockylinux:9 (push) Waiting to run
Linux / ubuntu:22.04 (push) Waiting to run
Linux / ubuntu:24.04 (push) Waiting to run
Linux / ubuntu:25.04 (push) Waiting to run
Linux / ubuntu:25.10 (push) Waiting to run
Windows / Windows (push) Waiting to run
Test internal cert generation & verification process
2026-01-07 12:00:28 +01:00
Yonas Habteab
0b2f22ce40 tlsutility: make cert ts configurable & use ASN1_TIME_compare for comparison 2025-12-04 13:01:48 +01:00
Julian Brost
fa3063d148 IsValidHeaderValue: use front()/back() instead of iterators
Don't ask me why I wasn't thinking of the very basic front() and back() methods
when writing this code. Does exactly the same here, but is much more
straight-forward than the extra iterator detour.
2025-12-03 11:09:44 +01:00
Julian Brost
985db970bb Allow to set extra headers in HTTP responses
Use case: Allow settings headers like Strict-Transport-Security if one likes.
How this headers would benefit the Icinga 2 API is questionable, but there are
security scanners that see HTTPS and complain about it, so this gives an easy
way to make them happy (with this probably being the only benefit).
2025-11-28 16:19:19 +01:00
Julian Brost
aca67f6d88 HttpUtility: add functions for validating HTTP header names and values 2025-11-28 16:19:19 +01:00
Brad Smith
bbc1859aa1 Have thread name length clamping also apply for the other OSes
This covers macOS, *BSDs, Linux, Cygwin.

NetBSD PTHREAD_MAX_NAMELEN_NP 32
macOS 64
OpenBSD 24
Linux/FreeBSD/DragonFly/Cygwin 16
2025-11-27 09:19:16 -05:00
Brad Smith
7aa777c40f Fix usage of pthread_setname_np() on NetBSD
NetBSD's pthread_setname_np() takes a slightly different set of parameters.
2025-11-27 07:16:34 -05:00
Alvar
8c230df3da
Merge pull request #10640 from brad0/openbsd_dlopen
Fix dlopen()'ing libraries on OpenBSD
2025-11-27 12:13:18 +00:00
Brad Smith
d243da72e5 Fix dlopen()'ing libraries on OpenBSD 2025-11-27 04:52:28 -05:00
Brad Smith
cf8fc3d64f
Add tests for pthread_set_name_np() and pthread_setname_np()
Looks like the conversion from autoconf to CMake dropped
these tests along the way.
2025-11-27 10:48:54 +01:00
Brad Smith
77881a7e18 Enable the pthread_np.h header on OpenBSD and DragonFly
Necessary for pthread_set_name_np().
2025-11-25 15:46:02 -05:00
Yonas Habteab
ed9014103f
Merge pull request #10609 from Icinga/fix-misc-compiler-warnings
Some checks failed
Container Image / Container Image (push) Has been cancelled
Linux / alpine:bash (push) Has been cancelled
Linux / amazonlinux:2 (push) Has been cancelled
Linux / amazonlinux:2023 (push) Has been cancelled
Linux / debian:11 (linux/386) (push) Has been cancelled
Linux / debian:11 (push) Has been cancelled
Linux / debian:12 (linux/386) (push) Has been cancelled
Linux / debian:12 (push) Has been cancelled
Linux / debian:13 (push) Has been cancelled
Linux / fedora:41 (push) Has been cancelled
Linux / fedora:42 (push) Has been cancelled
Linux / opensuse/leap:15.6 (push) Has been cancelled
Linux / opensuse/leap:16.0 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.6 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.7 (push) Has been cancelled
Linux / rockylinux/rockylinux:10 (push) Has been cancelled
Linux / rockylinux:8 (push) Has been cancelled
Linux / rockylinux:9 (push) Has been cancelled
Linux / ubuntu:22.04 (push) Has been cancelled
Linux / ubuntu:24.04 (push) Has been cancelled
Linux / ubuntu:25.04 (push) Has been cancelled
Windows / Windows (push) Has been cancelled
Fix misc compiler warnings
2025-11-19 14:26:57 +01:00
Johannes Schmidt
11e83b6274 Fix -Wunused-lambda-capture warning 2025-11-19 12:00:58 +01:00
Johannes Schmidt
a2e0ce426f Fix -Wunused-variable warnings 2025-11-19 12:00:58 +01:00
Johannes Schmidt
8ef1604f72 Fix -Wunused-but-set-variable warnings (clang) 2025-11-19 12:00:58 +01:00
Johannes Schmidt
6bd89821cd Fix -Wenum-compare warnings 2025-11-19 12:00:58 +01:00
Johannes Schmidt
7b4697a237 Fix -Wredundant-move warnings 2025-11-19 12:00:58 +01:00
Johannes Schmidt
93e69ed0e8 Fix -Wsign-compare warnings 2025-11-19 12:00:58 +01:00
Johannes Schmidt
758d1b6873 Fix -Wsuggest-override warnings 2025-11-19 12:00:58 +01:00
Johannes Schmidt
4f0a24f8ab Add ABORT() macro for unconditionally failing ASSERTS
This is necessary to stop MSVC complaining that "not all paths return a value", because
it is not able to infer that the expression `false ? 0 : non_returning_function()`
never returns.

In the process of debugging this I've also slightly simplified the other assert macros and
abort function, so they don't need compiler specific preprocessor-paths anymore.
2025-11-19 11:55:49 +01:00
Johannes Schmidt
9a69dd9a45 Use 64bit unsigned integer for Replay log timestamps 2025-11-19 09:41:13 +01:00
Yonas Habteab
017a4012f3 TimePeriod: properly validate ranges field 2025-11-14 16:38:41 +01:00
Johannes Schmidt
a9c139f5c5 Subtract inapplicable suppressed notifications at a later point
Without this commit, every time the NotificationTimerHandler runs it
will discard notifications that don't apply to the reason of the latest
check result. This is probably intended to clear outdated suppressed
notifications immediately when the TimePeriod resumes, but it also clears
out important ones (see the test case).

This commit fixes that by clearing out inapplicable notifications when
the timer runs the first time after the TimePeriod resumes. By that time
we can expect that no new suppressed notifications will be added and all
notifications that don't conflict with the last check-result can still be
run.

Fixes #10575
2025-11-03 15:39:39 +01:00
Johannes Schmidt
f42510f981
Merge pull request #9411 from Icinga/compiler-warnings
Some checks failed
Container Image / Container Image (push) Has been cancelled
Linux / alpine:bash (push) Has been cancelled
Linux / amazonlinux:2 (push) Has been cancelled
Linux / amazonlinux:2023 (push) Has been cancelled
Linux / debian:11 (linux/386) (push) Has been cancelled
Linux / debian:11 (push) Has been cancelled
Linux / debian:12 (linux/386) (push) Has been cancelled
Linux / debian:12 (push) Has been cancelled
Linux / debian:13 (push) Has been cancelled
Linux / fedora:41 (push) Has been cancelled
Linux / fedora:42 (push) Has been cancelled
Linux / opensuse/leap:15.6 (push) Has been cancelled
Linux / opensuse/leap:16.0 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.6 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.7 (push) Has been cancelled
Linux / rockylinux/rockylinux:10 (push) Has been cancelled
Linux / rockylinux:8 (push) Has been cancelled
Linux / rockylinux:9 (push) Has been cancelled
Linux / ubuntu:22.04 (push) Has been cancelled
Linux / ubuntu:24.04 (push) Has been cancelled
Linux / ubuntu:25.04 (push) Has been cancelled
Windows / Windows (push) Has been cancelled
Fix compiler warnings
2025-10-21 15:23:31 +02:00
Alexander A. Klimov
d877e818db Fix compiler warnings 2025-10-17 17:08:31 +02:00
Alexander A. Klimov
9612de881a Fix compiler warnings by not std::move()ing where redundant 2025-10-17 17:08:31 +02:00
Alexander A. Klimov
78631fa319 Fix compiler warnings by ensuring variable initialization 2025-10-17 17:08:31 +02:00
Alexander A. Klimov
315c9a3692 Fix compiler warnings by replacing x&&y||z with (x&&y)||z 2025-10-17 17:08:30 +02:00
Alexander Aleksandrovič Klimov
5d46ca4f77
Merge pull request #9730 from Icinga/don-t-define-use-openssl-callback-for-in-openssl-v1-1
Some checks failed
Container Image / Container Image (push) Has been cancelled
Linux / alpine:bash (push) Has been cancelled
Linux / amazonlinux:2 (push) Has been cancelled
Linux / amazonlinux:2023 (push) Has been cancelled
Linux / debian:11 (linux/386) (push) Has been cancelled
Linux / debian:11 (push) Has been cancelled
Linux / debian:12 (linux/386) (push) Has been cancelled
Linux / debian:12 (push) Has been cancelled
Linux / debian:13 (push) Has been cancelled
Linux / fedora:41 (push) Has been cancelled
Linux / fedora:42 (push) Has been cancelled
Linux / opensuse/leap:15.6 (push) Has been cancelled
Linux / opensuse/leap:16.0 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.6 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.7 (push) Has been cancelled
Linux / rockylinux/rockylinux:10 (push) Has been cancelled
Linux / rockylinux:8 (push) Has been cancelled
Linux / rockylinux:9 (push) Has been cancelled
Linux / ubuntu:22.04 (push) Has been cancelled
Linux / ubuntu:24.04 (push) Has been cancelled
Linux / ubuntu:25.04 (push) Has been cancelled
Windows / Windows (push) Has been cancelled
Don't define/use OpenSSL*Callback() for/in OpenSSL > v1.1
2025-10-17 16:41:07 +02:00
Alexander A. Klimov
37b5c39e20 Fix compiler warnings by re-ordering member init in constructors 2025-10-17 15:33:57 +02:00
Alexander Aleksandrovič Klimov
c25297e26a
Merge pull request #9729 from Icinga/fix-compiler-warnings-by-removing-unused-variables
Some checks are pending
Container Image / Container Image (push) Waiting to run
Linux / alpine:bash (push) Waiting to run
Linux / amazonlinux:2 (push) Waiting to run
Linux / amazonlinux:2023 (push) Waiting to run
Linux / debian:11 (linux/386) (push) Waiting to run
Linux / debian:11 (push) Waiting to run
Linux / debian:12 (linux/386) (push) Waiting to run
Linux / debian:12 (push) Waiting to run
Linux / debian:13 (push) Waiting to run
Linux / fedora:41 (push) Waiting to run
Linux / fedora:42 (push) Waiting to run
Linux / opensuse/leap:15.6 (push) Waiting to run
Linux / opensuse/leap:16.0 (push) Waiting to run
Linux / registry.suse.com/suse/sle15:15.6 (push) Waiting to run
Linux / registry.suse.com/suse/sle15:15.7 (push) Waiting to run
Linux / rockylinux/rockylinux:10 (push) Waiting to run
Linux / rockylinux:8 (push) Waiting to run
Linux / rockylinux:9 (push) Waiting to run
Linux / ubuntu:22.04 (push) Waiting to run
Linux / ubuntu:24.04 (push) Waiting to run
Linux / ubuntu:25.04 (push) Waiting to run
Windows / Windows (push) Waiting to run
Fix compiler warnings by removing unused variables
2025-10-17 15:12:05 +02:00
Alexander A. Klimov
728d6fff3e Don't define/use OpenSSL*Callback() for/in OpenSSL > v1.1
Since OpenSSL v1.1 the macros they're passed to expand to nothing creating
the illusion those functions aren't used. That triggers compiler warnings.
2025-10-17 14:28:00 +02:00
Alexander A. Klimov
3d69a31043 Fix compiler warnings by removing unused variables 2025-10-17 09:56:46 +02:00
Julian Brost
d372ecc20b AtomicOrLocked: use std::conditional_t and std::is_trivially_copyable_v
std::conditional_t was added in C++14, is_trivially_copyable_v in C++17, both
do the same as the previous implementation and are a bit more compact.
2025-10-16 16:50:03 +02:00
Julian Brost
a2dc35031c Remove obsolete workaround for GCC 4.x
The fallback implementation was added for GCC 4.x as that didn't yet implement
std::is_trivially_copyable. However, by now we're using C++17 as our language
standard and that wasn't even implemented in GCC 4.x yet[^1]:

    Some C++17 features are available since GCC 5, but support was experimental
    and the ABI of C++17 features was not stable until GCC 9.

Hence, this became more or less dead code and can be removed.

[^1]: https://gcc.gnu.org/projects/cxx-status.html#cxx17
2025-10-16 16:50:03 +02:00
Julian Brost
cfff82ba05
Merge commit from fork
Some checks are pending
Container Image / Container Image (push) Waiting to run
Linux / alpine:bash (push) Waiting to run
Linux / amazonlinux:2 (push) Waiting to run
Linux / amazonlinux:2023 (push) Waiting to run
Linux / debian:11 (linux/386) (push) Waiting to run
Linux / debian:11 (push) Waiting to run
Linux / debian:12 (linux/386) (push) Waiting to run
Linux / debian:12 (push) Waiting to run
Linux / debian:13 (push) Waiting to run
Linux / fedora:41 (push) Waiting to run
Linux / fedora:42 (push) Waiting to run
Linux / opensuse/leap:15.6 (push) Waiting to run
Linux / registry.suse.com/suse/sle15:15.6 (push) Waiting to run
Linux / registry.suse.com/suse/sle15:15.7 (push) Waiting to run
Linux / rockylinux/rockylinux:10 (push) Waiting to run
Linux / rockylinux:8 (push) Waiting to run
Linux / rockylinux:9 (push) Waiting to run
Linux / ubuntu:22.04 (push) Waiting to run
Linux / ubuntu:24.04 (push) Waiting to run
Linux / ubuntu:25.04 (push) Waiting to run
Windows / Windows (push) Waiting to run
DerefExpression: Add missing nullptr check
2025-10-16 14:14:45 +02:00
Julian Brost
56255ac7a6
Merge commit from fork
Check for permissions when evaluating object filters
2025-10-16 14:13:36 +02:00
Julian Brost
ce600ce01c
Merge pull request #10530 from Icinga/kill-drop-permissions
Send signals as Icinga user in safe-reload and logrotate
2025-10-08 14:29:27 +02:00