Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[report] Don't use sysroot for network device enumeration #3313

Merged
merged 1 commit into from Jul 31, 2023

Conversation

TurboTurtle
Copy link
Member

If sos is being used in a live environment to diagnose an issue, using sysroot can cause the network device enumeration via /sys/class/net crawling to fail. This will be the case for systems that do not use nmcli.

When in a live environment, network devices will not be under /$sysroot/sys/class/net but the "regular" path for the booted environment. Similarly, if sos is being run in a container that is properly configured, network devices will appear under /sys/class/net and not (necessarily) under the sysroot path that mounts the host's filesystem.

As such, disregard a configured sysroot when enumerating network devices by crawling /sys/class/net, and trap any exceptions that may percolate up from this in edge case environments.

Closes: #3307


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname email@example.com?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?

@packit-as-a-service
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3313
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

1 similar comment
@packit-as-a-service
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3313
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@TurboTurtle TurboTurtle added this to the 4.6.0 milestone Jul 21, 2023
If sos is being used in a live environment to diagnose an issue, using
sysroot can cause the network device enumeration via /sys/class/net
crawling to fail. This will be the case for systems that do not use
`nmcli`.

When in a live environment, network devices will not be under
`/$sysroot/sys/class/net` but the "regular" path for the booted
environment. Similarly, if sos is being run in a container that is
properly configured, network devices will appear under `/sys/class/net`
and not (necessarily) under the sysroot path that mounts the host's
filesystem.

As such, disregard a configured sysroot when enumerating network devices
by crawling `/sys/class/net`, and trap any exceptions that may percolate
up from this in edge case environments.

Related: sosreport#3307

Signed-off-by: Jake Hunsaker <jacob.r.hunsaker@gmail.com>
@TurboTurtle
Copy link
Member Author

I updated the commit message to be Related rather than Closes, since that issue has multiple fronts.

@TurboTurtle TurboTurtle merged commit 473f495 into sosreport:main Jul 31, 2023
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants