repo/gentoo:master commit in: eclass/
"Mike Gilbert" <[email protected]> Mon, 03 Aug 2026 18:19:21 +0000 (UTC)
| Newsgroups | gmane.linux.gentoo.cvs |
|---|---|
| Message-ID | <1785781045.04dc4e3dc26463748d8cad1dd4cb7076e6ee8b68.floppym@gentoo> |
commit: 04dc4e3dc26463748d8cad1dd4cb7076e6ee8b68
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 30 21:32:31 2026 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Aug 3 18:17:25 2026 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04dc4e3d
acct-user.eclass: simplify usermod error handling
We no longer attempt to unlock accounts with blank passwords, so we can
drop the code responsible for hiding that warning.
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
eclass/acct-user.eclass | 40 +++++++++++++++++-----------------------
1 file changed, 17 insertions(+), 23 deletions(-)
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index 0c8ba49bb837..273130ea19af 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -445,30 +445,24 @@ acct-user_pkg_postinst() {
fi
elog "Updating user ${ACCT_USER_NAME}"
- # usermod outputs a warning if unlocking the account would result in an
- # empty password. Hide stderr in a text file and display it if usermod fails.
- usermod "${opts[@]}" "${ACCT_USER_NAME}" 2>"${T}/usermod-error.log"
+ usermod "${opts[@]}" "${ACCT_USER_NAME}"
local status=$?
- if [[ ${status} -ne 0 ]]; then
- cat "${T}/usermod-error.log" >&2
- if [[ ${status} -eq 8 ]]; then
- # usermod refused to update the home directory
- # for a uid with active processes.
- eerror "Failed to update user ${ACCT_USER_NAME}"
- eerror "This user currently has one or more running processes."
- eerror "Please update this user manually with the following command:"
-
- # Surround opts with quotes.
- # With bash-5 (EAPI 8), we can use "${opts[@]@Q}" instead.
- local q="'"
- local optsq=( "${opts[@]/#/${q}}" )
- optsq=( "${optsq[@]/%/${q}}" )
-
- eerror " usermod ${optsq[*]} ${ACCT_USER_NAME}"
- else
- eerror "$(<"${T}/usermod-error.log")"
- die "usermod failed with status ${status}"
- fi
+ if [[ ${status} -eq 8 ]]; then
+ # usermod refused to update the home directory
+ # for a uid with active processes.
+ eerror "Failed to update user ${ACCT_USER_NAME}"
+ eerror "This user currently has one or more running processes."
+ eerror "Please update this user manually with the following command:"
+
+ # Surround opts with quotes.
+ # With bash-5 (EAPI 8), we can use "${opts[@]@Q}" instead.
+ local q="'"
+ local optsq=( "${opts[@]/#/${q}}" )
+ optsq=( "${optsq[@]/%/${q}}" )
+
+ eerror " usermod ${optsq[*]} ${ACCT_USER_NAME}"
+ elif [[ ${status} -ne 0 ]]; then
+ die "usermod failed with status ${status}"
fi
}