common: check user and group existence via id

Newer machines support the creation of users that don't appear in
/etc/passwd but are only available via nss or userdbd. Use getent passwd
to check for a users existence.

With this change I can run xfstests on systems where the users are
created via systemd-userdbd drop-ins. See the documentation in [1] and [2].

Link: [1]: https://man7.org/linux/man-pages/man8/nss-systemd.8.html
Link: [2]: https://man7.org/linux/man-pages/man5/nsswitch.conf.5.html
Signed-off-by: Christian Brauner <brauner@kernel.org>
1 file changed