ent 14382/3.24 - #6250
Closed
craigcomstock wants to merge 288 commits into
Closed
Conversation
head -c 8 doesn't work on hpux 11.23 that we test on currently dd count=1 bs=8 should work on all UNIX systems tr on solaris needs LC_CTYPE=C as it can't handle binary data. Silence not found sysctl command where it is not present. Ticket: ENT-9786 Changelog: title (cherry picked from commit be724b2)
…s missing Previously cf-support would fail if core dumps were present and gdb was missing. We only want a warning and a log of which files are available for anlysis in this case. Ticket: ENT-9786 Changelog: title (cherry picked from commit 8194ff5)
Adjusted cf-support for exotic UNIX platforms (3.24)
Do not crash cf-promises if no argument is given for following functions: * readfile * iprange * isipinsubnet (cherry picked from commit e040d7f) Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
libpromises/evalfunction: Do not crash w/o arguments (3.24.x)
Fixed bug where `DBPrivWriteCursorEntry()` in `dbm_lmdb.c` always assigns `sizeof(size_t)` to the key size. Fixed it by adding another attribute for keeping track of its size in the respective `DBCursorPriv_` struct. Ticket: None Changelog: Title Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> (cherry picked from commit cc93519)
This field can be used to acknowledge an update to an incoming or outgoing host entry in the lastseen DB. The field is set to `false` when a key-value pair is updated. `cf-hub` may at any time acknowledge that the update has been observed by setting the field to `true`. Ticket: ENT-11838 Changelog: Title Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> Co-authored-by: Craig Comstock <craig.comstock@northern.tech> (cherry picked from commit 4a9c281)
Added function to acknowledge the observation of a lastseen entry in DB. Ticket: ENT-11838 Changelog: None Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> (cherry picked from commit 5debe98)
In case of LMDB migration failures, the respective database file is moved to the side, and a fresh database is created. Ticket: None Changelog: Commit Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> (cherry picked from commit ee82601)
Ticket: None Changelog: Title Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> (cherry picked from commit 11e8716)
The logic to generate the path of the LMDB backup directories used timestamps in order to create a "unique" backup directory. If two backups where created with the same timestamp, `mkdir()` would fail and the program would later segfault. I fixed this by modifying the logic to use `mkdtemp()` instead, guaranteeing a unique directory. Furthermore, the code now handles the returned `NULL` pointer caused by `EEXISTS`. I decided to keep the timestamp as well, because it's nice for filtering out the latest backup. Ticket: None Changelog: Title Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> (cherry picked from commit 526f354)
ENT-11838: Fixed perpetual warnings that a deleted host has checked in (3.24.x)
… cppcheck version printout Added notes about how --config-cache (-C) helps make libntech configuration faster by re-using core's results. Ticket: none Changelog: none (cherry picked from commit 0fead4f) Conflicts: .github/workflows/job-static-check.yml 3.24.x doesn't use librsync so there was a conflict.
(cherry picked from commit 83ab827)
(cherry picked from commit d180e6b)
Ticket: none Changelog: none (cherry picked from commit 05a36b5)
…-check-fixes/3.24 2025 03 06 static check fixes/3.24
This memory issue caused segmentation faults in the package_commands_useshell.cf acceptance test on SPARC Solaris 11 after upgrading PCRE2 to version 10.45. The memory issue was found with the help of valgrind. Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> (cherry picked from commit aecb4a2)
…ll-3.24.x Fixed invalid read of size 8 in function FirstBackReference (3.24.x)
ChangeLog: Title Ticket: ENT-12712 Signed-off-by: Ihor Aleksandrychiev <ihor.aleksandrychiev@northern.tech> (cherry picked from commit 79a2165)
ENT-12712: Fixed incorrect exit code handling in cf-runagent (3.24.x)
…ssors to avoid cppcheckerror segfaults Just a wild guess at how to fix a flakey issue we see fairly often. Ticket: ENT-11515 Changelog: none (cherry picked from commit cd4dce1)
Adjusted static-checks test to use half the number of available processors to avoid cppcheckerror segfaults (3.24)
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech> (cherry picked from commit 882efff)
GH Actions: Removed unused Windows acceptance tests workflow (3.24)
This commit was added while working on implementing the File Stream API in ticket ENT-12414. The File Stream API utilizes librsync. To begin with I had `AC_CHECK_HEADERS([librsync_export.h], [], AC_MSG_ERROR(Cannot find librsync))` in configure.ac. This file did not exist in earlier versions of librync. Hence, I upgraded the Ubuntu platforms in GitHub CI to make configure work. Later a realized that I should remove that line enirely to make CFEngine compatible with earlier versions. However, it does not hurt to upgrade the Ubuntu platforms, so decided on keeping this commit. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> (cherry picked from commit 758e065)
…buntu Replaced GitHub CI platforms with Ubuntu 24 (3.24)
Ticket: ENT-12732 Changelog: none (cherry picked from commit 2763daf)
Ticket: ENT-12766 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> (cherry picked from commit 88e6052)
Ticket: ENT-14145 Changelog: Title (cherry picked from commit 172983c)
Ticket: ENT-14035 Changelog: none Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
…ntech-pathwalk-fix-3.24.x ENT-14145: Bumped libntech to include PathWalk fix (3.24)
existing_info was allocated via xcalloc but never freed on the early-return (preserve) path, the early-return (read error) path, or the normal fall-through path. (cherry picked from commit 9eaebef)
Replace the generic "Updating persistent class" verbose message with context-aware messages that distinguish between: - Creating a new persistent class (no prior DB record) - Resetting a timer (existing record, policy=reset) - Updating a preserved class (tags changed or class expired) This makes it easier to diagnose persistent class timer behavior from verbose logs without needing to add custom debugging builds. Ticket: ENT-3868 Changelog: Title (cherry picked from commit 51650ed)
…x-backport-persistent-leak ENT-3868: Improved persistent class logging and plugged memory leak (3.24)
…ntSave ValueSizeDB() was called with strlen(key), but WriteDB(), ReadDB() and DeleteDB() store and look up keys with strlen(key) + 1 (including the terminating NUL), and LMDB matches keys by exact byte length. The lookup therefore never found the stored record and always reported size 0. Passing strlen(key) + 1 makes the lookup match the key as written. This lets EvalContextHeapPersistentSave() find an existing record and act on it: preserve an already-set, unexpired timer (CONTEXT_STATE_POLICY_PRESERVE) and log "Resetting" rather than "Creating" on a RESET save. Ticket: CFE-4681 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit c90ccba)
Add a timer_policy attribute to classes: promises, controlling whether a
persistent class timer resets on re-evaluation ("reset") or preserves the
original expiry ("absolute"). Defaults to "absolute" for backward
compatibility; planned to change to "reset" in 3.28.0 to match classes
bodies, keeping "absolute" on the 3.24 and 3.27 LTS backports.
timer_policy without persistence is now an error, since it only governs
the persistence timer.
Ticket: CFE-4681
Changelog: Title
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 53afadc)
The new timer_policy tests referenced ../../default.sub.cf (the master filename); on 3.24.x the harness file is default.cf.sub. Correct the include so cf-promises can validate the policy instead of falling to failsafe. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CFE-4681: timer_policy support for classes: promise (3.24)
ProtocolOpenDir()/ProtocolGet() receive up to CF_MSGSIZE bytes into a char buf[CF_MSGSIZE], but the receive primitives NUL-terminate at buf[received] where received can equal CF_MSGSIZE -- one past the array (TLSRecv/RecvSocketStream both write toget+1 bytes). Drives the real ProtocolOpenDir() over a classic-protocol socketpair with a record-filling reply. Aborts under AddressSanitizer on current code, passes once the buffers are sized CF_BUFSIZE (cfengine#6171). Ref: CFE-4687, cfengine#6171 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit a79b5ce)
(cherry picked from commit 2d5f4ae)
CFE-4687: Fixed off-by-one in protocol recv buffers (3.24)
An insert_lines promise using select_region with select_end_match_eof cannot select the region of the final section when that section header is the last line of the file. The region is empty and sits at the end of the file, SelectRegion() rejects it, and the insertion fails with "could not select an edit region". This test fails today and will pass once SelectRegion() honors select_end_match_eof for an empty region at end of file. Ticket: CFE-2663 Changelog: None Signed-off-by: Nick Anderson <nick@cmdln.org> (cherry picked from commit ebf30a2)
When select_region matched a start delimiter on the last line of the file and include_start_delimiter was false, SelectRegion() rejected the region as an "empty region at the end of file" and the edit failed with "could not select an edit region". This happened even when select_end_match_eof was true, which is meant to let the region extend to the end of the file. Now the empty region at end of file is accepted when select_end_match_eof is set, so a trailing section (its header being the last line of the file) can still be populated by insert_lines and similar promises. Ticket: CFE-2663 Changelog: Title Signed-off-by: Nick Anderson <nick@cmdln.org> (cherry picked from commit c7bcc44)
Pulls in the macOS build fixes from ENT-14208: the deprecated readdir_r use in unix_dir.c (PR cfengine#280) and the switch to __APPLE__ instead of DARWIN (PR cfengine#281). This unblocks the macOS build for the CFE-2663 backport. Stops deliberately at the ent-14208 merge, short of the CFE-3629 compiler-flag rework (libntech 257982d). That rework enables -Wgnu-folding-constant as an error, which breaks the pre-existing VLA in libpromises/evalfunction.c (char key[key_len]) that master has since removed but these backport branches still carry. Ticket: ENT-14208 Changelog: None Signed-off-by: Nick Anderson <nick@cmdln.org>
While VLAs are supported in C99 and C11, they do pose some portability issues so best to avoid their use. alloca() allocates on the stack frame and is free'd on exit from the function so essentially equivalent. Ticket: ENT-14208 Changelog: none (cherry picked from commit 6e95201)
The shared acceptance-test include is named default.cf.sub on 3.24.x (1998 tests use that name), but the CFE-2663 test was cherry-picked from master where it is default.sub.cf. cf-promises could not stat the file, so the policy failed validation and the test reported UNEXPECTED FAILURE. Point the include at the 3.24.x name. Ticket: CFE-2663 Changelog: None Signed-off-by: Nick Anderson <nick@cmdln.org>
CFE-2663: Select empty region at end of file when select_end_match_eof is set (3.24)
Ticket: none Changelog: none
This will catch more warnings as errors and help us keep our code cleaner. Ticket: ENT-14208 Changelog: none (cherry picked from commit 7544e66)
…rom_datacontainer Ticket: ENT-14036 Changelog: None Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech> (cherry picked from commit 4c6bb8e)
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech> (cherry picked from commit 210c807)
…ow-maintenance-3.24 2026 06 25 workflow maintenance 3.24
When `/var/cfengine/enable_report_dumps` is present cf-serverd will log information provided to cf-hub in `/var/cfengine/diagnostics/report_dumps`. This change makes sure those are collected by cf-support for review. Ticket: ENT-5083 Changelog: None (cherry picked from commit 82ba092)
Added enterprise client report dumps to cf-support collection (3.24)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-i libpromises/cf3lex.c944af92to11be681