diff options
author | 2018-07-22 23:41:40 +0000 | |
---|---|---|
committer | 2018-07-22 23:41:40 +0000 | |
commit | 4d6f3a13bac990c80e77cf1d42d053a876432a77 (patch) | |
tree | a749288a204ba7ee7e3880e4ed0d9f3933000070 /libc/gen/pw_scan.c | |
parent | 8517a3136742981ad794e45454b834c050c3b016 (diff) | |
download | pw-darwin-4d6f3a13bac990c80e77cf1d42d053a876432a77.tar.gz pw-darwin-4d6f3a13bac990c80e77cf1d42d053a876432a77.tar.zst pw-darwin-4d6f3a13bac990c80e77cf1d42d053a876432a77.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 'libc/gen/pw_scan.c')
0 files changed, 0 insertions, 0 deletions