Commit Graph

197 Commits

Author SHA1 Message Date
Michael Friedrich 96f62d2d34 Add Utility::ParseVersion() and unit tests
This now uses a regex to extract the short version
similar to how Icinga Web 2 does it.

Additional unit tests prove the rule.
2019-08-14 11:22:55 +02:00
Alexander A. Klimov 5afef1015d Replace unlink() with boost::filesystem::remove()
refs #7101
2019-04-25 09:53:02 +02:00
Alexander A. Klimov 5a17722c1f Replace _unlink() + rename() with boost::filesystem::rename()
refs #7101
2019-04-25 09:53:02 +02:00
Alexander A. Klimov f1f7d0c4d6 Work around boost::filesystem::path bug on VS
refs #7101
2019-04-25 09:53:01 +02:00
Alexander A. Klimov af78cd6050 Use Boost.Filesystem
refs #7101
2019-04-25 09:53:01 +02:00
Alexander A. Klimov a72f4db5c9 Utility::ValidateUTF8(): use UTF8-CPP 2019-03-15 13:34:20 +01:00
Michael Friedrich d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Alexander A. Klimov 9558ebc0f4 Secure ApiUser::GetByAuthHeader() against timing attacks 2019-02-22 16:59:36 +01:00
Alexander A. Klimov 17e86f98a2 Make UnameHelper() efficient
refs #6452
2018-12-20 16:37:04 +01:00
Michael Friedrich f3cd3eb870 DSL: Implement getenv()
This patch also restores Utility::GetFromEnvironment()
and replaces the hardcoded `getenv()` calls.
2018-11-19 18:11:16 +01:00
Michael Friedrich dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Jean Flach ed4e008e79 Rework sysconfig file
The sysconfig file now only contains the defaults as comments, changes
made there are given to the init.d script, prepare-dirs, safe-reload and
Icinga 2 itself. If nothing is set in the sysconfig file (as is the
default as all lines are commented out) the defaults are used.

fixes #6255
2018-05-23 15:18:42 +02:00
Michael Friedrich e6f214fa29 Log warning when sysconfig file cannot be read
refs #6215
2018-04-19 10:09:09 +02:00
Jean Flach c8c193a9d8 Remove need for RunAsUser/Group
They are now read form the sysconfig file which is owned by root
2018-02-20 14:16:43 +01:00
Gunnar Beutner 94e6be1a65 Remove unused includes 2018-01-22 09:52:29 +01:00
Gunnar Beutner e0c350b8a5 Apply clang-tidy fix 'modernize-use-nullptr' 2018-01-04 12:24:57 +01:00
Gunnar Beutner becfa85094 Apply clang-tidy fix 'modernize-use-emplace' 2018-01-04 12:24:57 +01:00
Gunnar Beutner e3ad0be769 Apply clang-tidy fix 'modernize-use-auto' 2018-01-04 12:24:57 +01:00
Gunnar Beutner ac155d1dda Apply clang-tidy fix 'modernize-redundant-void-arg' 2018-01-04 12:24:57 +01:00
Michael Friedrich e08da4267b
Merge pull request #5930 from Icinga/feature/boost-function
Replace boost::function with std::function
2018-01-02 13:46:23 +01:00
Michael Insel 158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Gunnar Beutner dac71b3960 Replace boost::function with std::function 2018-01-02 08:55:50 +01:00
Jean Flach 2636e6a77a Whitespace fix
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
2017-12-20 14:53:52 +01:00
Michael Friedrich 20d7221dfe
Merge pull request #5865 from Icinga/fix/uuid
Add missing initializer in Utility::NewUniqueID()
2017-12-15 09:08:26 +01:00
Gunnar Beutner 3403844b74
Merge pull request #5863 from Icinga/fix/glob-5859
Fix glob error handling
2017-12-14 19:08:54 +01:00
Gunnar Beutner a6887b1ae9 Add missing initializer in Utility::NewUniqueID() 2017-12-14 19:07:14 +01:00
Jean Flach e45ede6271 Fix glob error handling
fixes #5859
2017-12-14 17:04:35 +01:00
Gunnar Beutner 1ad83886ac Replace a few more NULLs with nullptr 2017-12-14 15:37:20 +01:00
Gunnar Beutner 96e214221d Remove unused variables 2017-12-14 08:50:09 +01:00
Gunnar Beutner 3c60fbf75d Use std::vector::emplace_back instead of std::vector::push_back 2017-11-30 17:47:09 +01:00
Gunnar Beutner 9ce950b0f1 Replace boost::ref/boost::cref with std::ref/std::cref 2017-11-30 17:47:09 +01:00
Gunnar Beutner 7d7eaa8dd3 Replace boost::thread with std::thread 2017-11-30 17:39:20 +01:00
Gunnar Beutner 858873b940 Replace boost::bind/boost::function with std::bind/std::function 2017-11-27 15:15:11 +01:00
Gunnar Beutner 6f8b62333f Use real UUIDs for Utility::NewUniqueID 2017-11-07 13:53:04 +01:00
Gunnar Beutner f2d437e96c Implement support for migrating certificates to /var/lib/icinga2/certs
This commit includes documentation too.

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
2017-10-20 14:06:02 +02:00
Edgar Fuß 1fc6d8c899 Fix for traditional glob(3) behaviour
fixes #4778
2017-02-09 09:08:48 +01:00
Edgar Fuß 7414df4ef8 Fix lsb_release/sw_vers errors on NetBSD
fixes #4779
2017-02-08 17:47:09 +01:00
Michael Friedrich b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Gunnar Beutner 288413f046 Replace BOOST_FOREACH with range-based for loops
fixes #12538
2016-08-25 06:46:17 +02:00
Gunnar Beutner aeaca5e803 Revert "Fix incorrect detection of the 'Concurrency' variable"
This reverts commit 585f0537d2.

refs #12456
2016-08-19 11:58:52 +02:00
Gunnar Beutner 585f0537d2 Fix incorrect detection of the 'Concurrency' variable
fixes #12456
2016-08-17 09:20:05 +02:00
Rune Darrud 5c0b3c58bd Do not escape backslashes and separators twice
fixes #12227

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-08-17 06:10:41 +02:00
Timo Buhrmester 148b4da285 Don't violate POSIX by ensuring that the argument to usleep(3) is less than 1000000
fixes #12391

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-08-10 12:29:52 +02:00
Markus Frosch a5abe1a972 Allow debugging of Utility::GetTime
So we can run unit tests that expect a certain behavior based on time.

When Icinga 2 is compiled with I2_DEBUG one can use Utility::SetTime to
override the current system time, and lock it to this value.

fixes #11875
2016-06-09 14:25:51 +02:00
Gunnar Beutner eab2fb79ad Fix crash in UnameHelper()
fixes #11714
2016-05-10 09:46:48 +02:00
Gunnar Beutner 327d12295c Implement support for upgrading NSIS-based installations
refs #11449
2016-04-01 08:42:58 +02:00
Gunnar Beutner 6bf3225e84 Implement support for running custom install/uninstall actions
refs #11449
2016-03-31 14:53:54 +02:00
Gunnar Beutner 016f47d6e6 Fix Utility::MkDirP on Windows
fixes #11455
2016-03-29 09:44:05 +02:00
Gunnar Beutner 71060be89a Follow symlinks in Utility::GlobRecursive
fixes #11347
2016-03-22 08:22:11 +01:00
Michael Friedrich 65cbf04454 Fix: MkDirP supports '/' and '\' on Windows
fixes #10231
2016-03-07 09:22:07 +01:00