`id -P` usage survey

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Wed, 13 Aug 2025 04:48:55 UTC
Hi,

I was looking at using `id -P` and was surprised to learn that it will 
in-fact dump out password hashes when run as root.

I'm not really proposing coercing them to '*', but I am curious to hear 
from anyone that uses `id -P` about their use-cases.

In my case, I was planning to use it to build a slimmed down 
master.passwd into a chroot for some test cases, but for something like 
that I'd be tempted to add a `--sanitized` option or second level of 
`-P` to suppress the hashes of users I grab from the host (mostly to 
avoid taking some unnecessary risk of, e.g., them ending up getting 
leaked into some test results output or something with non-Kyua test 
runners).  Right now I post-process them to strip the field, but I'd 
love to nix the extra step.

OTOH, I guess I'm already requiring the unprivileged-user to be 
configured for these tests, so I could `su -m $unpriv_user -c 'id -P 
tests'` instead.

Thanks,

Kyle Evans