From: Michał Górny Date: Fri, 5 Jul 2019 10:01:39 +0000 (+0200) Subject: acct-user.eclass: Skip locking if account does not exist X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d61d24f4818eef45f8e7ba2e4a7c508ad5bdfb43;p=gentoo.git acct-user.eclass: Skip locking if account does not exist Closes: https://bugs.gentoo.org/689308 Signed-off-by: Michał Górny --- 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)"