Skip to content

DMI inventory now skips sysfs files that cf-agent cannot read (3.24.x) - #3246

Draft
larsewi wants to merge 1 commit into
cfengine:3.24.xfrom
larsewi:dmi-sysfs-isreadable-3.24.x
Draft

larsewi wants to merge 1 commit into
cfengine:3.24.xfrom
larsewi:dmi-sysfs-isreadable-3.24.x

Conversation

@larsewi

@larsewi larsewi commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Some files in `/sys/devices/virtual/dmi/id/`, such as `product_serial`,
are only readable by root. `fileexists()` lets `readfile()` run anyway,
causing unprivileged agents to log a permission denied error.

Instead we use `isreadable()` to guard the read. However, `isreadable()`
is only available in CFEngine >= 3.22.

Changelog: Title
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit 640062b)
@larsewi

larsewi commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@cf-bottom Jenkins please :)

@cf-bottom

Copy link
Copy Markdown

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.

2 participants