repo/gentoo:master commit in: eclass/
"Mike Gilbert" <[email protected]> Mon, 03 Aug 2026 18:19:21 +0000 (UTC)
| Newsgroups | gmane.linux.gentoo.cvs |
|---|---|
| Message-ID | <1785781042.ffbff0a1e0bf96f249ac4c8fbe2cdfcede501412.floppym@gentoo> |
commit: ffbff0a1e0bf96f249ac4c8fbe2cdfcede501412
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 30 21:20:36 2026 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Aug 3 18:17:22 2026 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffbff0a1
user-info.eclass: egetent: support shadow database
This will be used by acct-user.eclass.
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
eclass/user-info.eclass | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/eclass/user-info.eclass b/eclass/user-info.eclass
index 3e2bdecfe047..ceef6638cecf 100644
--- a/eclass/user-info.eclass
+++ b/eclass/user-info.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: user-info.eclass
@@ -22,7 +22,7 @@ esac
# Small wrapper for getent (Linux), nidump (< Mac OS X 10.5),
# dscl (Mac OS X 10.5), and pw (FreeBSD) used in enewuser()/enewgroup().
#
-# Supported databases: group passwd
+# Supported databases: group passwd shadow
# Warning: This function can be used only in pkg_* phases when ROOT is valid.
egetent() {
local db=$1 key=$2
@@ -30,7 +30,7 @@ egetent() {
[[ $# -ge 3 ]] && die "usage: egetent <database> <key>"
case ${db} in
- passwd|group) ;;
+ group|passwd|shadow) ;;
*) die "sorry, database '${db}' not yet supported; file a bug" ;;
esac
@@ -63,7 +63,7 @@ egetent() {
type -p nscd >/dev/null && nscd -i "${db}" 2>/dev/null
getent "${db}" "${key}"
else
- if [[ ${key} =~ ^[[:digit:]]+$ ]]; then
+ if [[ ${db} != shadow && ${key} =~ ^[[:digit:]]+$ ]]; then
grep -E "^([^:]*:){2}${key}:" "${ROOT}/etc/${db}"
else
grep "^${key}:" "${ROOT}/etc/${db}"