Skip to content

Commit

Permalink
acct-user.eclass: Don't modify users when EPREFIX is non-empty
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
chewi committed Dec 14, 2022
1 parent 89620ce commit eabd386
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eclass/acct-user.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eabd386

Please sign in to comment.