Skip to content

Commit

Permalink
16216 FIX Resolve Runas section in Checkmk Linux agent
Browse files Browse the repository at this point in the history
Prior to this werk, the Runas section of the Checkmk agent
contained a wrong trailing slash which resulted in an error
with the find command. As a direct consequence, some or
potentially all Runas rules were inadvertently ignored, leading
to the plugin, not intended for root, being executed with root
privileges. This werk fixes this behaviour.

Change-Id: Iaa3ace9b4d1eb1c3e554826dc537d53be98ebe84
  • Loading branch information
godspeed-you authored and anthonyh209 committed Nov 15, 2023
1 parent cb4cf44 commit 92c4992
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .werks/16216
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Title: Resolve Runas section in Checkmk Linux agent
Class: fix
Compatible: compat
Component: checks
Date: 1699515827
Edition: cre
Level: 1
Version: 2.3.0b1

Prior to this werk, the Runas section of the Checkmk agent
contained a wrong trailing slash which resulted in an error
with the find command. As a direct consequence, some or
potentially all Runas rules were inadvertently ignored, leading
to the plugin, not intended for root, being executed with root
privileges. This werk fixes this behaviour.
2 changes: 1 addition & 1 deletion agents/check_mk_agent.linux
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ run_runas_executor() {
echo "<<<local:sep(0)>>>"
fi

find "${configfile}/" -executable -type f |
find "${configfile}" -executable -type f |
while read -r filename; do
if [ -n "${prefix}" ]; then
# SC2086: We don't want to quote since prefix should not be treated as a
Expand Down

0 comments on commit 92c4992

Please sign in to comment.