summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2022-12-08 09:20:54 +0000
committerJames Le Cuirot <chewi@gentoo.org>2022-12-14 22:08:04 +0000
commiteabd386679e85e14532642e4fd03585acb6e881a (patch)
tree6d9b61fa6501a16fb1f7c58afc8f0b865a5cfc23 /eclass/acct-user.eclass
parentprofiles: Last-rite games-engines/residualvm (diff)
downloadgentoo-eabd386679e85e14532642e4fd03585acb6e881a.tar.gz
gentoo-eabd386679e85e14532642e4fd03585acb6e881a.tar.bz2
gentoo-eabd386679e85e14532642e4fd03585acb6e881a.zip
acct-user.eclass: Don't modify users when EPREFIX is non-empty
This was happening when running a prefix as root, which we don't really support, but also when building a prefixed system under ROOT. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'eclass/acct-user.eclass')
-rw-r--r--eclass/acct-user.eclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index b15599c5dd6f..a37e12121f83 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -181,7 +181,7 @@ acct-user_add_deps() {
eislocked() {
[[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
- if [[ ${EUID} -ne 0 ]]; then
+ if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return 0
fi
@@ -332,7 +332,7 @@ acct-user_pkg_preinst() {
unset _ACCT_USER_ADDED
- if [[ ${EUID} -ne 0 ]]; then
+ if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return
fi
@@ -405,7 +405,7 @@ acct-user_pkg_postinst() {
return
fi
- if [[ ${EUID} -ne 0 ]]; then
+ if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return
fi
@@ -454,7 +454,7 @@ acct-user_pkg_prerm() {
return
fi
- if [[ ${EUID} -ne 0 ]]; then
+ if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
return
fi