From e51c5cfae41952f32a75c9e680785f4c1242f9b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 30 Jul 2019 16:45:38 +0200 Subject: [PATCH] user.eclass: Use egetent in eget{user,group}name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- eclass/user.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.26.2