Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Fri, 05 Jul 2019 15:44:38
Message-Id: 1562341459.d61d24f4818eef45f8e7ba2e4a7c508ad5bdfb43.mgorny@gentoo
1 commit: d61d24f4818eef45f8e7ba2e4a7c508ad5bdfb43
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 5 10:01:39 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 5 15:44:19 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d61d24f4
7
8 acct-user.eclass: Skip locking if account does not exist
9
10 Closes: https://bugs.gentoo.org/689308
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 eclass/acct-user.eclass | 6 ++++++
14 1 file changed, 6 insertions(+)
15
16 diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
17 index 1b8a0bf94a6..2df00a8730e 100644
18 --- a/eclass/acct-user.eclass
19 +++ b/eclass/acct-user.eclass
20 @@ -363,6 +363,12 @@ acct-user_pkg_prerm() {
21 debug-print-function ${FUNCNAME} "${@}"
22
23 if [[ -z ${REPLACED_BY_VERSION} ]]; then
24 + if [[ -z $(egetent passwd "${ACCT_USER_NAME}") ]]; then
25 + ewarn "User account not found: ${ACCT_USER_NAME}"
26 + ewarn "Locking process will be skipped."
27 + return
28 + fi
29 +
30 esetshell "${ACCT_USER_NAME}" -1
31 esetcomment "${ACCT_USER_NAME}" \
32 "$(egetcomment "${ACCT_USER_NAME}"); user account removed @ $(date +%Y-%m-%d)"