summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2019-07-30 16:45:38 +0200
committerMike Gilbert <floppym@gentoo.org>2019-08-12 23:00:28 -0400
commite51c5cfae41952f32a75c9e680785f4c1242f9b7 (patch)
tree1e508518cbaaf955d8638abead1a221b77f1fb3b /eclass
parentdev-db/mysql: bump (diff)
downloadgentoo-e51c5cfae41952f32a75c9e680785f4c1242f9b7.tar.gz
gentoo-e51c5cfae41952f32a75c9e680785f4c1242f9b7.tar.bz2
gentoo-e51c5cfae41952f32a75c9e680785f4c1242f9b7.zip
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 <mgorny@gentoo.org> Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/user.eclass4
1 files 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 <uid>"
- id -u -n "$1"
+ egetent passwd "$1" | cut -d: -f1
}
# @FUNCTION: egetgroupname
@@ -368,7 +368,7 @@ egetusername() {
egetgroupname() {
[[ $# -eq 1 ]] || die "usage: egetgroupname <gid>"
- id -g -n "$1"
+ egetent group "$1" | cut -d: -f1
}
# @FUNCTION: egethome