> On Nov 15, 2020, at 1:05 PM, Stefan Esser <s...@freebsd.org> wrote:
> 
> Am 15.11.20 um 20:41 schrieb Kyle Evans:
>> This is a separate (valid) problem, but not directly related to
>> Scott's work here. sysctlbyname now goes directly to the kernel with
>> no chance for the user.* sysctls to intercept. That should
>> independently be fixed to maintain the illusion that they're real
>> sysctl's.
> 
> user.localbase is a real sysctl, but with a default value returned
> when sysctl(3) is used.
> 
> The getlocalbase() function should not depend on this default value,
> since it contains an identicl default value that can be returned if
> sysctlbyname fails (or rather returns a zero length string in case
> no other value has been written to the kernel).
> 

sysctlbyname() was returning success and an empty string.  getlocalbase()
has no way to know if this was intentional or not, so it can’t rationally check.
Switching to sysctlnametomib() + sysctl() seems to solve this problem.

However, I’m going to revert all of this and let the experts decide on the
best path forward.

Scott

_______________________________________________
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to