summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2019-07-05 12:01:39 +0200
committerMichał Górny <mgorny@gentoo.org>2019-07-05 17:44:19 +0200
commitd61d24f4818eef45f8e7ba2e4a7c508ad5bdfb43 (patch)
treee671e30fe623fbb620d951bf6eed16d4de3b23fd /eclass/acct-user.eclass
parentmedia-libs/openjpeg: stable 2.3.1 for hppa, bug #646774 (diff)
downloadgentoo-d61d24f4818eef45f8e7ba2e4a7c508ad5bdfb43.tar.gz
gentoo-d61d24f4818eef45f8e7ba2e4a7c508ad5bdfb43.tar.bz2
gentoo-d61d24f4818eef45f8e7ba2e4a7c508ad5bdfb43.zip
acct-user.eclass: Skip locking if account does not exist
Closes: https://bugs.gentoo.org/689308 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/acct-user.eclass')
-rw-r--r--eclass/acct-user.eclass6
1 files changed, 6 insertions, 0 deletions
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)"