Skip to content

DMI inventory now skips sysfs files that cf-agent cannot read - #3240

Open
larsewi wants to merge 1 commit into
cfengine:masterfrom
larsewi:dmi-sysfs-isreadable
Open

larsewi wants to merge 1 commit into
cfengine:masterfrom
larsewi:dmi-sysfs-isreadable

Conversation

@larsewi

@larsewi larsewi commented Nov 8, 2026

Copy link
Copy Markdown
Contributor
  • Some files in /sys/devices/virtual/dmi/id/, such as product_serial, are only readable by root. The fileexists() guard let readfile() run anyway, so unprivileged agents logged CfReadFile: Error while reading file '/sys/devices/virtual/dmi/id/product_serial' (Permission denied).
  • This makes every masterfiles acceptance test fail with "Error printed" on runners that expose product_serial (e.g. the enterprise masterfiles_acceptance_tests job).
  • On 3.22.0 and later the read is now guarded by isreadable(), like /sys/hypervisor/uuid further up. Older agents keep fileexists().

🤖 Generated with Claude Code

Some files in `/sys/devices/virtual/dmi/id/`, such as `product_serial`,
are only readable by root. `fileexists()` let `readfile()` run anyway, so
unprivileged agents logged a permission denied error. On 3.22.0 and later,
`isreadable()` guards the read instead.

Changelog: Title
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi

larsewi commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

@cf-bottom Jenkins please :)

@cf-bottom

Copy link
Copy Markdown

@larsewi

larsewi commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@cf-bottom Jenkins please :)

@cf-bottom

Copy link
Copy Markdown

@larsewi
larsewi marked this pull request as ready for review November 9, 2026 13:19
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