Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 28 Mar 2022 19:48:08
Message-Id: 1648496840.243c29db87acbbb655ebdf06d301052a709ec992.ulm@gentoo
1 commit: 243c29db87acbbb655ebdf06d301052a709ec992
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Mar 26 09:48:25 2022 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 28 19:47:20 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=243c29db
7
8 acct-user.eclass: Refuse to lock out the superuser
9
10 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
11
12 eclass/acct-user.eclass | 5 +++++
13 1 file changed, 5 insertions(+)
14
15 diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
16 index 2e2e1152f9ad..f2aaefc2ee39 100644
17 --- a/eclass/acct-user.eclass
18 +++ b/eclass/acct-user.eclass
19 @@ -473,6 +473,11 @@ acct-user_pkg_prerm() {
20 return 0
21 fi
22
23 + if [[ ${ACCT_USER_ID} -eq 0 ]]; then
24 + elog "Refusing to lock out the superuser (UID 0)"
25 + return 0
26 + fi
27 +
28 if [[ -z ${REPLACED_BY_VERSION} ]]; then
29 if [[ -z $(egetent passwd "${ACCT_USER_NAME}") ]]; then
30 ewarn "User account not found: ${ACCT_USER_NAME}"