From: Michał Górny Date: Tue, 30 Jul 2019 14:45:38 +0000 (+0200) Subject: user.eclass: Use egetent in eget{user,group}name X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=e51c5cfae41952f32a75c9e680785f4c1242f9b7;p=gentoo.git user.eclass: Use egetent in eget{user,group}name Use egetent+cut to obtain user/group names rather than id(1). The latter has no real advantage (besides being shorter to type), and does not work correctly for getting groups. Closes: https://bugs.gentoo.org/691056 Signed-off-by: Michał Górny Signed-off-by: Mike Gilbert --- diff --git a/eclass/user.eclass b/eclass/user.eclass index a3cacb6d5f10..f433d32bf7ed 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -358,7 +358,7 @@ enewgroup() { egetusername() { [[ $# -eq 1 ]] || die "usage: egetusername " - id -u -n "$1" + egetent passwd "$1" | cut -d: -f1 } # @FUNCTION: egetgroupname @@ -368,7 +368,7 @@ egetusername() { egetgroupname() { [[ $# -eq 1 ]] || die "usage: egetgroupname " - id -g -n "$1" + egetent group "$1" | cut -d: -f1 } # @FUNCTION: egethome