Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jul 2018 14:43:55 +0000
From:      Li-Wen Hsu <lwhsu@FreeBSD.org>
To:        Ian Lepore <ian@FreeBSD.org>
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: svn commit: r336751 - head/usr.sbin/pw
Message-ID:  <20180727144355.GA47251@freefall.freebsd.org>
In-Reply-To: <201807262003.w6QK3B7E026934@repo.freebsd.org>
References:  <201807262003.w6QK3B7E026934@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 26, 2018 at 20:03:11 +0000, Ian Lepore wrote:
> Author: ian
> Date: Thu Jul 26 20:03:11 2018
> New Revision: 336751
> URL: https://svnweb.freebsd.org/changeset/base/336751
> 
> Log:
>   Re-apply r336625 which was reverted with r336638, now that the underlying
>   pw_scan(3) has been fixed in a way that doesn't perturb other callers of
>   it or the getpwnam(3) family.
>   
>   Make pw(8) showuser work the same with or without -R <path> for non-root
>   users.  Without -R, pw(8) uses getpwnam(3), which will open master.passwd
>   for the root user or passwd for non-root users.  With -R <path> pw(8) was
>   always opening <path>/master.passwd, which would fail for a non-root user,
>   then falsely claim the userid you're trying to show doesn't exist.
>   
>   Now for a non-root user it opens <path>/passwd, and populates the fields in
>   the returned struct passwd which aren't present in that file with well-known
>   canonical values, which duplicates the behavior of getpwnam(3).  The net
>   effect is that the showuser output is identical whether using -R or not.
> 
> Modified:
>   head/usr.sbin/pw/pw_vpw.c

Hi Ian,

It seems usr.sbin.pw.* tests are failing after this commit:

https://ci.freebsd.org/job/FreeBSD-head-amd64-test/8367/testReport/

Can you help me check this is realted to the new pw code or there is
anything we need to modify in the test VM setup or running environment.

The related artifacts are available here:

https://artifact.ci.freebsd.org/snapshot/head/r336751/amd64/amd64/

You can use disk-test.img.xz which is a VM with setup testing
environment.  The build script will start automatically but you can
ctrl-c to interrupt anytime and run tests by hand:

cd /usr/tests/usr.sbin/pw
kyua test


Thanks,
Li-Wen


-- 
Li-Wen Hsu <lwhsu@FreeBSD.org>
https://lwhsu.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180727144355.GA47251>