summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorBenda Xu <heroxbd@gentoo.org>2020-02-18 20:56:45 +0800
committerBenda Xu <heroxbd@gentoo.org>2020-02-21 16:14:13 +0800
commit37420386c65f55b677aca4bcc1afb18bfe22ee73 (patch)
treeaa33a43a131355e19a2b98c8de24053e16f1f688 /eclass
parentdev-libs/cudnn: Introduce use flags for CUDA versions. (diff)
downloadgentoo-37420386c65f55b677aca4bcc1afb18bfe22ee73.tar.gz
gentoo-37420386c65f55b677aca4bcc1afb18bfe22ee73.tar.bz2
gentoo-37420386c65f55b677aca4bcc1afb18bfe22ee73.zip
eclass/acct-user.eclass: disable pkg_* on Prefix.
Gentoo Prefix runs with a normal user and cannot manage any other user. Exit gracefully with a message. Closes: https://bugs.gentoo.org/709570 Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/acct-user.eclass10
1 files changed, 10 insertions, 0 deletions
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index be6b3dd3e600..e3ec3966035d 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -360,6 +360,11 @@ acct-user_pkg_preinst() {
acct-user_pkg_postinst() {
debug-print-function ${FUNCNAME} "${@}"
+ if [[ ${EUID} != 0 ]] ; then
+ einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
+ return 0
+ fi
+
# NB: eset* functions check current value
esethome "${ACCT_USER_NAME}" "${ACCT_USER_HOME}"
esetshell "${ACCT_USER_NAME}" "${ACCT_USER_SHELL}"
@@ -376,6 +381,11 @@ acct-user_pkg_postinst() {
acct-user_pkg_prerm() {
debug-print-function ${FUNCNAME} "${@}"
+ if [[ ${EUID} != 0 ]] ; then
+ einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
+ return 0
+ fi
+
if [[ -z ${REPLACED_BY_VERSION} ]]; then
if [[ -z $(egetent passwd "${ACCT_USER_NAME}") ]]; then
ewarn "User account not found: ${ACCT_USER_NAME}"