Skip to content

[Bug]: processors.extensions fact 'unknown' on Ubuntu 26.04 / need to use uname -m on machines with uutils/coreutils version of uname #95

@alavaliant

Description

@alavaliant

Is this a critical security issue?

  • This is not a security issue.

Describe the Bug

I've noticed that on my Ubuntu 26.04 machine the fact processors.extensions is returning "unknown" rather than the expected result;

# facter -p processors.extensions
[
  "unknown"
]

Expected Behavior

The fact value should have had the supported extensions returned. e.g.

# facter -p processors.extensions
[
  "x86_64",
  "x86_64-v1",
  "x86_64-v2",
  "x86_64-v3"
]

Steps to Reproduce

On a Ubuntu 26.04 machine with openvox/openfact installed. Run in a shell

 facter -p processors.extensions

Environment

Version 8.25.0-1+ubuntu26.04
Platform Ubuntu 26.04

Additional Context

Tracing through the code. The extensions value is read via Facter::Resolvers::Uname.resolve(:processor)
https://github.com/OpenVoxProject/openfact/blob/main/lib/facter/resolvers/linux/processors.rb#L38:~:text=extensions

But on OSes like Ubuntu 26.04 the uname installed by default is the https://github.com/uutils/coreutils version. Which returns "unknown" to the uname -p command

# uname -p
unknown

which would appear to the the source of the unexpected fact value.

Reading bug reports like https://bugs.launchpad.net/ubuntu/+source/coreutils-from/+bug/2122648
It looks like the uutils/coreutils dev aren't going to implement the uname -p flag, but they recommend uname -m as a replacement.

# uname -m
x86_64

Which does indeed look like it would return the wanted value for the processors.extensions fact. And the non uutils uname command also seems to return the wanted value via uname -m as well.

So I'd suggest to fix this. That https://github.com/OpenVoxProject/openfact/blob/main/lib/facter/resolvers/linux/processors.rb#L38:~:text=extensions (and potentially any other cases where Facter::Resolvers::Uname.resolve(:processor) is used). Is changed to Facter::Resolvers::Uname.resolve(:machine) Which should correct the fact value on machines where the uutils/coreutils are installed.

Relevant log output

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