Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rex::Hardware::VirtInfo does not handle stuff properly outside of Linux #1603

Open
VVelox opened this issue Aug 7, 2023 · 0 comments
Open
Labels
triage needed A potential bug that needs to be reproduced and understood

Comments

@VVelox
Copy link
Contributor

VVelox commented Aug 7, 2023

Describe the bug

Rex::Hardware::VirtInfo assumes that it is being ran on Linux and does not properly use Rex::Inventory::Bios::get, which is the proper cross platform manner to the non kernel module info this module uses.

That said Rex::Inventory::Bios::get does not work as non-root so grabbing when it can via the relevent items under /sys on Linux works.

See https://github.com/RexOps/Rex/pull/1599/files for a fix for this.

Similarly $modules is fetched in a Linux specific manner. Should be /sbin/kldstat on FreeBSD.

The module check for kvm should only work on Linux.

Expected behavior

Works in a cross platform manner via dmidecode via Rex::Inventory::Bios::get.

How to reproduce it

Using on something other than Linux such as FreeBSD.

Code example

use Rex; use Rex::Commands::Gather; dump_system_information;

Additional context

No response

Rex version

1.14.2

Perl version

5.32.1

Operating system running rex

FreeBSD

Operating system managed by rex

FreeBSD and Linux

How rex was installed?

package manager

@VVelox VVelox added the triage needed A potential bug that needs to be reproduced and understood label Aug 7, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
triage needed A potential bug that needs to be reproduced and understood
Projects
None yet
Development

No branches or pull requests

1 participant