aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2023-09-25 16:42:35 +0200
committerChristian Brauner <brauner@kernel.org>2023-09-26 11:06:07 +0200
commit6b825af30487e0d9aba0ecb5549db2f1a75da306 (patch)
tree88e0cb7ff656e056b496844aac50f1f0f27655e6
parent78d0783746cb2b199c5f10b61a6c7fec547dd36f (diff)
downloadxfstests-dev-b4/fstests-check-user.tar.gz
common: check user and group existence via idb4/fstests-check-user
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>
-rw-r--r--common/rc2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/rc b/common/rc
index 76a7e77403..c2f844809a 100644
--- a/common/rc
+++ b/common/rc
@@ -2450,7 +2450,7 @@ _yp_active()
_cat_passwd()
{
[ $(_yp_active) -eq 0 ] && ypcat passwd
- cat /etc/passwd
+ getent passwd
}
# cat the group file