Skip to content

[Bug]: networking.interfaces tries macOS ipconfig(8) on non-macOS #76

Description

@klemensn

Is this a critical security issue?

  • This is not a security issue.

Describe the Bug

There's no point in executing a command for which the program does not exist:

result = Facter::Core::Execution.execute("ipconfig getoption #{interface_name} " \

It also seems odd that despite passing a single fact for a single interface, besaid command is still tried for all interfaces:

$ facter --debug networking.interfaces.iwx0 2>&1 | grep ipconfig
[2026-02-08 20:20:54.915390 ] DEBUG Facter::Core::Execution::Posix - Executing command: ipconfig getoption iwx0 server_identifier 
[2026-02-08 20:20:54.919833 ] DEBUG Facter::Core::Execution::Posix - Failed while executing 'ipconfig getoption iwx0 server_identifier': No such file or directory - ipconfig 
... repeats for every interface on the system ...

Expected Behavior

Do not try to execute platform specific programs known to not exist.

Steps to Reproduce

  1. use networking.interfaces on non-macOS
  2. observe execution failure in --debug logs, via ktrace(1) or the like

Environment

openfact 5.3.0 on OpenBSD 7.8-current.

Additional Context

No response

Relevant log output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions