From d61d24f4818eef45f8e7ba2e4a7c508ad5bdfb43 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 5 Jul 2019 12:01:39 +0200 Subject: [PATCH] acct-user.eclass: Skip locking if account does not exist MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Closes: https://bugs.gentoo.org/689308 Signed-off-by: Michał Górny --- eclass/acct-user.eclass | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass index 1b8a0bf94a62..2df00a8730eb 100644 --- a/eclass/acct-user.eclass +++ b/eclass/acct-user.eclass @@ -363,6 +363,12 @@ acct-user_pkg_prerm() { debug-print-function ${FUNCNAME} "${@}" if [[ -z ${REPLACED_BY_VERSION} ]]; then + if [[ -z $(egetent passwd "${ACCT_USER_NAME}") ]]; then + ewarn "User account not found: ${ACCT_USER_NAME}" + ewarn "Locking process will be skipped." + return + fi + esetshell "${ACCT_USER_NAME}" -1 esetcomment "${ACCT_USER_NAME}" \ "$(egetcomment "${ACCT_USER_NAME}"); user account removed @ $(date +%Y-%m-%d)" -- 2.26.2