From ddcd547f9c09586b20b240ba9aaa3ed256563d22 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Wed, 15 Oct 2025 14:03:04 -0500 Subject: [PATCH] Fixed cf-support usage of coredumpctl matching Initially we had coredumpctl info /var/cfengine/bin/cf-* which matched the EXE (executable name). We then changed this to /var/cfengine/* which was an incorrect change which limited the EXE to only items at /var/cfengine/ since the star is a glob and expanded to the files in that directory. (commit: 68b8429a85a86f88592a96f5ff3a0f6b857465c9) Instead we should use a find command to find files that are executable under /var/cfengine and run coredumpctl on each one we find. Ticket: ENT-13272 Changelog: title (cherry picked from commit b2f22a237680da3358e6ae809bc72f0f4099aed0) Conflicts: misc/cf-support We didn't cherry pick the previous bad fix in 68b8429 mentioned above so conflicts were present. --- misc/cf-support | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/cf-support b/misc/cf-support index ce59602680..9c5e82eee5 100755 --- a/misc/cf-support +++ b/misc/cf-support @@ -158,7 +158,10 @@ fi if expr "$_sysctl_kernel_core_pattern" : ".*/systemd-coredump.*" > /dev/null 2>&1; then echo "Found systemd-coredump used in sysctl kernel.core_pattern \"$_sysctl_kernel_core_pattern\"" echo "Using coredumpctl to analyze CFEngine core dumps" - coredumpctl info /var/cfengine/bin/cf-* 2>/dev/null >> "$_core_log" || true + find /var/cfengine -type f -executable | while IFS='' read -r line + do + coredumpctl info "$line" 2>/dev/null >> "$_core_log" || true + done elif command -v apport-unpack >/dev/null; then echo "Using apport-unpack to analyze CFEngine core dumps" # each crash report has a line with ExecutablePath: which tells us if it is a CFEngine core dump