HomeFreeBSD

whereis: fix fetching of user.cs_path sysctl variable

Description

whereis: fix fetching of user.cs_path sysctl variable

The current implementation of sysctlbyname() does not support the user
sub-tree. This function exits with a return value of 0, but sets the
passed string buffer to an empty string.

As a result, the whereis program did not use the value of the sysctl
variable "user.cs_path", but only the value of the environment
variable "PATH".

This update makes whereis use the sysctl function with a fixed OID,
which already supports the user sub-tree.

(cherry picked from commit c454c57163574ace86b49626b06637e93e05d5e6)

Details

Provenance
seAuthored on Feb 4 2022, 10:37 PM
Parents
rGf0163795c589: dev/pci: fix potential panic due to bogus VPD data
Branches
Unknown
Tags
Unknown