summaryrefslogtreecommitdiffstats
path: root/pw/cpdir.c
diff options
context:
space:
mode:
authorIan Lepore <ian@FreeBSD.org>2018-07-22 23:41:40 +0000
committerIan Lepore <ian@FreeBSD.org>2018-07-22 23:41:40 +0000
commita97b359809759494438052dd4984a4f77b4bfd5d (patch)
treec0e691eb8cf951a316c781a55d99c6820fd39065 /pw/cpdir.c
parent5d9f253bb5e0cfe6848f6ceb730fe13e9494b460 (diff)
downloadpw-darwin-a97b359809759494438052dd4984a4f77b4bfd5d.tar.gz
pw-darwin-a97b359809759494438052dd4984a4f77b4bfd5d.tar.zst
pw-darwin-a97b359809759494438052dd4984a4f77b4bfd5d.zip
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 zeroes out the 3 fields that aren't available in the passwd file, 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/cpdir.c')
0 files changed, 0 insertions, 0 deletions