Skip to content

ent 14382/3.24 - #6250

Closed
craigcomstock wants to merge 288 commits into
cfengine:masterfrom
craigcomstock:ent-14382/3.24
Closed

ent 14382/3.24#6250
craigcomstock wants to merge 288 commits into
cfengine:masterfrom
craigcomstock:ent-14382/3.24

Conversation

@craigcomstock

Copy link
Copy Markdown
Contributor
  • Bumped .CFVERSION number to 3.24.1
  • 3.24.0 changelog: Added note about sys.cfengine_roles and related classes
  • Update branches to test against with new LTS: master, 3.24.x and 3.21.x
  • Log errors for commands promises with exit codes not matching any _returncodes
  • Added logging CFEngine component related SELinux denials in cf-support
  • Atomic copy_from in files promise
  • Workaround cppcheck ignoring -i libpromises/cf3lex.c
  • Fixed failure to install cf-remote
  • Fixed error in static checks
  • Also ignore IPv6 interface info
  • Adjusted peer related examples in regards to hostname -f versus sys.fqhost
  • Added changelog for 3.24.1
  • Adjusted CFEngine SELinux policy to allow cf-execd to run ps command with policy version 33
  • Disabled windows_acceptance_tests in github CI due to 6 hour time limit
  • Added filesystem and files unconfined access to cf-monitord in cfengine-enterprise SELinux policy
  • Adjusted SELinux policy to allow components which run cf-promises to getattr everywhere and read symlinks
  • Added sys_ptrace access for apachectl to run ps in CFEngine SELinux enterprise policy
  • Added getattr access for cf-serverd to socket file in CFEngine SELinux policy
  • Added getattr capability for cert_t:dir as needed to CFEngine components in cfengine-enterprise SELinux policy
  • Added create capability on cfengine_var_lib_t:dir to cf-hub
  • Granted more access to certificates directory for CFEngine components in SELinux policy
  • Added late changelog entry for SELinux fixes (3.24)
  • Bumped .CFVERSION number to 3.24.2
  • SELinux: Allow cf-serverd to set its own limits
  • Adjusted cf-support for exotic UNIX platforms
  • Adjusted cf-support to not fail if core dumps are available and gdb is missing
  • libpromises/evalfunction: Do not crash w/o arguments
  • Fixed bug causing LMDB database corruption
  • Re-enabled DB migration support for LMDB
  • Added acknowledged field to lastseen DB
  • Added acknowledge function for lastseen entries
  • Handle LMDB migration failures
  • Now creates backup before LMDB migration
  • Fixed possible segfault when backing up LMDB databases
  • Minimized resources for static-check (package dependencies) and added cppcheck version printout
  • address static-check complaints
  • bump libntech to master
  • Fixed static-check to not configure when running autogen.
  • Fixed invalid read of size 8 in function FirstBackReference
  • Fixed incorrect exit code handling in cf-runagent
  • Adjusted static-checks test to use half the number of available processors to avoid cppcheckerror segfaults
  • GH Actions: Removed unused Windows acceptance tests workflow
  • Replaced GitHub CI platforms with Ubuntu 24
  • Fixed whitespace typo in message about Cannot open software_packages.csv
  • Fixed ODR violations in ASAN Unit Tests
  • Removed unnecessary dependencies from libtest
  • Soft fail rlist_test on macOS
  • changelog-generator: Fixed syntax error in regex
  • Updated changelogs for 3.24.2
  • Fixed bug in parsing process_select for Windows
  • Soft fail rlist_test on AIX
  • Amended 3.24.2 changelog
  • Added http_port and getattr selinux permissions as needed for selinux policy on rhel-8 and rhel-9
  • 3.24.2 changelog ammendment 4
  • Bumped .CFVERSION number to 3.24.3
  • Manjaro Linux proper identification Co-authored-by: Lars Erik Wik 53906608+larsewi@users.noreply.github.com
  • sysinfo.c: Removed trailing whitespace
  • Define suse class on SLED systems
  • Adjusted configure.ac for finding workdir, logdir and piddir on windows platform
  • verify_files.c: Added missing include for cf3.defs.h
  • files_edit.c: Added missing include for cf3.defs.h
  • verify_files.c: Removed trailing white space
  • Properly handle promise locking with edit line
  • valgrind-check: Fixed missing curl
  • valgrind-check: fix missing archives
  • Aligned testing with implementation of bundle edit_line set_variable_values_ini
  • Fixed bug where remote file copy always preserves source perms
  • Fixed invalid colon separating host and path from cifs and panfs in fstab
  • Added documentation references for file system table configuration
  • Atomic permissions during file copy
  • Use current process ID to investigate proc filesystem to workaround in-container non-root owned symlinks
  • Added error message when netstat file is not found during UNIX interface discovery.
  • Move GetRelocatedProcdirRoot() from libntech and add GetProcdirPid()
  • Added env var pid override in proc-net acceptance test To align with change to reading /proc//...
  • examples/services: Fix service_bundle example
  • bump libntech to master
  • macos_unit_tests.yml: specified the deployment target to be macOS 15.4
  • GH Actions: Installed libyaml on macOS to fix build errors
  • CFE-4385: Fix build on macOS
  • Adjusted curl_easy_setopt() calls to use long argument
  • Added example using nth() with key
  • Update examples/nth-key.cf
  • Fixed crash in readyaml when parsing an empty file
  • Fixed cf-support usage of coredumpctl matching
  • Updated OpenBSD instructions to match latest package versions
  • Adjusted valgrind-check Containerfile to ensure apt update and install are linked and cached together in one layer
  • Extended support for move_obstructions beyond copy_from
  • Adjusted selinux policy to be more resilient to updates
  • Added sysvinit cf-php-fpm service script for Mission Portal
  • Removed useless output from cfengine3 init script
  • Fixed move_obstructions support when using content, and edit_template
  • Added 3.24.3 ChangeLog entries
  • ChangeLog: Reordered 3.24.3 and 3.24.2 changelogs
  • ChangeLog: Find and replace improvements for consistency
  • ChangeLog: Made small manual adjustments to 3.24.3 changelog
  • Added note to INSTALL about procps package requirement for process promises on alpine linux
  • Adjusted cf3_with_library to handle case where --with-feature is not defined
  • Added soft fail marker to copy_from_ciphers_success test on RedHat 10
  • Added skip for run_lastseen_threaded_load.sh test on HP/UX
  • Fixed struct stat layout mismatch on HP-UX due to include order
  • Fixed diskfree() returning garbage value
  • Fixed length checking in StatFile
  • See ticket for info
  • verify_users_pam.c: fixed whitespace issues
  • Execute users commands directly instead through a shell
  • Changed severity of log level in CreateTableColumns()
  • Fixed use of uninitialized buffer in CreateTableColumns()
  • Fixed buffer overflow in CreateTableColumns()
  • cf_sql.{c,h}: constified arguments in DB query functions
  • Constified command argument in ExecPackageCommand()
  • Packages promiser is now escaped when using shell commands
  • Fixed package related acceptance test for Windows platform related to quoting arguments
  • Changed ChangePasswordHashUsingChpass logging info
  • Do not log executed command by ExecuteUserCommand
  • Fixed buffer overflow in build XPath for edit_xml
  • Fixed potential buffer overflow when converting strings to GIDs/UIDs
  • Fixed potential buffer overflow when computing chroot path
  • Fixed buffer overflow in cf-secret when using multiple keys of different sizes
  • files_editline.c: removed trailing whitespace
  • Fixed heap buffer overflow in files edit_line
  • Bumped .CFVERSION number to 3.24.4
  • Fix owner on file creation with content attribute
  • 013.cf: Skipped failing test on HP-UX
  • 013.cf: Added reference to test skip
  • 013.cf: also skip failing test on aix
  • Fixed buffer overflow in the files promise
  • Fixed memory leak in isreadable() policy function
  • Fixed NULL pointer dereference in AddSimpleUidItem() and AddSimpleGidItem()
  • Added CVE references to changelog
  • Added safeguard to static-check runner in case of 1 proc host
  • Adjusted startup timeout for valgrind-checks test to 4 minutes from 2
  • cf-check: Fixed error message about replication only being available for LMDB
  • Added RHEL 10 specific SELinux policy
  • Fixed segfault when cf-secret print-headers is called without an encrypted file
  • Updated plucked.cf.sub using make pluck
  • Removed duplicate definitions of lines_present bundle
  • Added test for select_region convergence across passes
  • Enabled select_region to converge across multiple passes
  • Bumped libntech to master
  • Added trailing sep in acceptance tests
  • Fix MinGW cross-compilation: ws2_32 linkage and snprintf C99 detection
  • changelog-generator: Emit markdown bullets without leading tabs
  • Revert "changelog-generator: Emit markdown bullets without leading tabs"
  • Added changelog for 3.24.4
  • Revert "Merge pull request Revert "changelog-generator: Emit markdown bullets without leading tabs" (3.24.x) #6088 from larsewi/revert-changelog-generator-markdown-3.24.x"
  • ENT-13497: Renamed changelog file to CHANGELOG.md
  • Improved CHANGELOG.md markdown formatting
  • Use backticks for inline code in CHANGELOG.md
  • CHANGELOG.md: Formatted markdown file
  • CHANGELOG.md: Updated changelog entries for 3.24.4
  • Remove mpf changelog entry
  • Added missing RHEL9 SELinux rules
  • Added mpf_masterfiles_stage_build_always flag file to enable legacy behavior of masterfiles-stage to always run cfbs build
  • Updated changelog for 3.24.4
  • Cleaned up changelog for 3.24.4
  • Bumped .CFVERSION number to 3.24.5
  • Fix inet_ntop/inet_pton declaration check for MinGW cross-compilation
  • Fixed daemon hang on SIGTERM during child process wait
  • Poll waitpid(WNOHANG) so daemons can react to SIGTERM
  • Suppressed spurious validation error log on SIGTERM
  • Pinned source ownership in copy_from acceptance tests
  • Fixed cf-agent SIGABRT on SIGTERM during early policy validation
  • Added 2 most recent self upgrade log files to cf-support collection
  • cf-execd.service: drain cf-agent on stop
  • ENT-14145: Bumped libntech to include PathWalk fix (3.24)
  • Fix: Update tests to be properly escaped
  • Fix memory leak of existing_info in EvalContextHeapPersistentSave
  • Improve persistent class logging in EvalContextHeapPersistentSave
  • Fixed key length in existing-record lookup in EvalContextHeapPersistentSave
  • CFE-4681: timer_policy support for classes: promises
  • CFE-4681: fix acceptance test harness include path for 3.24.x
  • test: surface off-by-one in protocol recv buffers (CFE-4687)
  • fix off-by-one in ProtocolGet and ProtocolOpenDir recv buffers
  • test: add acceptance test for CFE-2663 (empty trailing region)
  • Reformatted to satisfy lint
  • Fixed select_region failing to select an empty region at end of file
  • Bump libntech from 944af92 to 11be681
  • Refactored variable length array code to use alloca()
  • Fixed CFE-2663 acceptance test include path on 3.24.x
  • Bump libntech to latest
  • Added -Wextra and -Wno-sign-compare to github workflow gcc options
  • Fix: Added missing comma in json - getindices_returns_expected_list_from_datacontainer
  • rules.json: Added missing comma
  • Added enterprise client report dumps to cf-support collection
  • bump libntech to ent-14382 branch for testing

craigcomstock and others added 30 commits December 12, 2024 12:57
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)
For some reason DB migration for LMDB was removed in 2014 (in commit
8611970). Unfortunately there is no
mention as to why this was done. I will try to re-enable it.

Ticket: None
Changelog: Title
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit 9703d8e)
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)
nickanderson and others added 28 commits June 2, 2026 09:45
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)
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)
@craigcomstock
craigcomstock deleted the ent-14382/3.24 branch July 29, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.