diff options
author | Aaron Walker <ka0ttic@gentoo.org> | 2005-09-27 12:38:56 +0000 |
---|---|---|
committer | Aaron Walker <ka0ttic@gentoo.org> | 2005-09-27 12:38:56 +0000 |
commit | f20aa063045efda768114a51cc651860ecb62703 (patch) | |
tree | c24fbedf78b6388c95dec8d036dec09fd4e218ef /eclass | |
parent | New ebuild including an udev-Run-rule and hplj 1020 Support thanks to Czirkos... (diff) | |
download | historical-f20aa063045efda768114a51cc651860ecb62703.tar.gz historical-f20aa063045efda768114a51cc651860ecb62703.tar.bz2 historical-f20aa063045efda768114a51cc651860ecb62703.zip |
Fix BSD portion of egetent() so that lookup by uid/gid works as expected.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/eutils.eclass | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index a272525d0656..d9b8f93454a1 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.202 2005/09/26 21:54:56 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.203 2005/09/27 12:38:56 ka0ttic Exp $ # # Author: Martin Schlemmer <azarah@gentoo.org> # @@ -420,14 +420,15 @@ egetent() { ;; esac elif [[ "${USERLAND}" == "BSD" ]] ; then - local action - if [ "$1" == "passwd" ] - then - action="user" - else - action="group" + local opts action="user" + [[ $1 == "passwd" ]] || action="group" + + # lookup by uid/gid + if [[ $2 == [[:digit:]]* ]] ; then + [[ ${action} == "user" ]] && opts="-u" || opts="-g" fi - pw show "${action}" "$2" -q + + pw show ${action} ${opts} "$2" -q else which nscd >& /dev/null && nscd -i "$1" getent "$1" "$2" |