diff options
author | Ian Lepore <ian@FreeBSD.org> | 2018-07-26 20:03:11 +0000 |
---|---|---|
committer | Ian Lepore <ian@FreeBSD.org> | 2018-07-26 20:03:11 +0000 |
commit | 59e370118429dc4d56d94ff61ef1dc26dd1d774e (patch) | |
tree | c0e691eb8cf951a316c781a55d99c6820fd39065 /pw/grupd.c | |
parent | 6da8ae1fefae4690a06e473d8a5a6bd262495e46 (diff) | |
download | pw-darwin-59e370118429dc4d56d94ff61ef1dc26dd1d774e.tar.gz pw-darwin-59e370118429dc4d56d94ff61ef1dc26dd1d774e.tar.zst pw-darwin-59e370118429dc4d56d94ff61ef1dc26dd1d774e.zip |
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.
Diffstat (limited to 'pw/grupd.c')
0 files changed, 0 insertions, 0 deletions