Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Warner Losh
On Sun, Nov 15, 2020 at 1:13 PM Scott Long wrote: > > > On Nov 15, 2020, at 1:05 PM, Warner Losh wrote: > > > > Hey Scott, > > > > On Sun, Nov 15, 2020 at 11:46 AM Scott Long wrote: > > The man page for strlcpy() made reference to the return value being > > equivalent to what snprintf() does.

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Scott Long
> On Nov 15, 2020, at 1:05 PM, Warner Losh wrote: > > Hey Scott, > > On Sun, Nov 15, 2020 at 11:46 AM Scott Long wrote: > The man page for strlcpy() made reference to the return value being > equivalent to what snprintf() does. The man page for snprintf() states > that negatve return values a

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Warner Losh
Hey Scott, On Sun, Nov 15, 2020 at 11:46 AM Scott Long wrote: > The man page for strlcpy() made reference to the return value being > equivalent to what snprintf() does. The man page for snprintf() states > that negatve return values are possible, so I assumed the same was > true for strlcpy().

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Brandon Bergren
That would explain why I see what I see -- I did not install an updated libc yet. On Sun, Nov 15, 2020, at 1:34 PM, Scott Long wrote: > It is a magical namespace, in that it comes from libc, not from the > kernel. Please make sure that you’ve installed a more recent libc, I > guess? I just di

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Scott Long
It is a magical namespace, in that it comes from libc, not from the kernel. Please make sure that you’ve installed a more recent libc, I guess? I just did a full build and install, and I’m unable to replicate the problem. Maybe there’s a static-linked pkg running around somewhere? I’m at a l

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Brandon Bergren
I think the problem is that user.* is somehow magically namespaced, so doing a "dumb" sysctlbyname will get the wrong one. sysctl (the tool) does: __sysctl("sysctl.name2oid user.localbase",2,0xfbfffde98,0xfbfffda98,0x810809000,14) = 0 (0x0) __sysctl("sysctl.oidfmt user.localbase",4,0xff

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Jessica Clarke
On 15 Nov 2020, at 19:10, Brandon Bergren wrote: > > On powerpc64 and powerpc64le, there is some really weird behavior happening > around the sysctl itself: > > root@crow:~ # pkg > The package management tool is not yet installed on your system. > Do you want to fetch and install it now? [y/N]:

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Brandon Bergren
On powerpc64 and powerpc64le, there is some really weird behavior happening around the sysctl itself: root@crow:~ # pkg The package management tool is not yet installed on your system. Do you want to fetch and install it now? [y/N]: N root@crow:~ # sysctl user.localbase user.localbase: /usr/local

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Scott Long
> On Nov 15, 2020, at 12:01 PM, Jessica Clarke wrote: >> >> I felt similar concerns, but my misunderstanding of strlcpy() drove the >> result. Since the use case for getlocalbase() lends itself to also use >> strlcat()/strlcpy(), I was trying to replicate the API semantics of those, >> at least

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Jessica Clarke
On 15 Nov 2020, at 18:46, Scott Long wrote: >> On Nov 15, 2020, at 11:31 AM, Jessica Clarke wrote: >> >> Hi Scott, >> I'm concerned by this diff; see my comments below. >> >>> On 15 Nov 2020, at 07:48, Scott Long wrote: >>> >>> Author: scottl >>> Date: Sun Nov 15 07:48:52 2020 >>> New Revisio

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Scott Long
> On Nov 15, 2020, at 11:31 AM, Jessica Clarke wrote: > > Hi Scott, > I'm concerned by this diff; see my comments below. > >> On 15 Nov 2020, at 07:48, Scott Long wrote: >> >> Author: scottl >> Date: Sun Nov 15 07:48:52 2020 >> New Revision: 367701 >> URL: https://svnweb.freebsd.org/changese

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Jessica Clarke
Hi Scott, I'm concerned by this diff; see my comments below. > On 15 Nov 2020, at 07:48, Scott Long wrote: > > Author: scottl > Date: Sun Nov 15 07:48:52 2020 > New Revision: 367701 > URL: https://svnweb.freebsd.org/changeset/base/367701 > > Log: > Because getlocalbase() returns -1 on error, i

Re: svn commit: r367701 - head/lib/libutil

2020-11-15 Thread Igor Kolesnik
> Modified: head/lib/libutil/getlocalbase.c > == > --- head/lib/libutil/getlocalbase.c Sun Nov 15 01:54:44 2020 > (r367700) > +++ head/lib/libutil/getlocalbase.c Sun Nov 15 07:48:52 2020 > (r367701) > @