diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass index e82f3c56db..ec4a4eaf39 100644 --- a/eclass/acct-user.eclass +++ b/eclass/acct-user.eclass @@ -212,7 +212,7 @@ elockuser() { ;; *) - usermod -e 1 -L "$1" || die "Locking account $1 failed" + usermod -R ${ROOT} -e 1 -L "$1" || die "Locking account $1 failed" ;; esac @@ -256,7 +256,7 @@ eunlockuser() { *) # silence warning if account does not have a password - usermod -e "" -U "$1" 2>/dev/null || die "Unlocking account $1 failed" + usermod -R ${ROOT} -e "" -U "$1" 2>/dev/null || die "Unlocking account $1 failed" ;; esac diff --git a/eclass/user-info.eclass b/eclass/user-info.eclass index 15e9238ab4..67b447d661 100644 --- a/eclass/user-info.eclass +++ b/eclass/user-info.eclass @@ -47,8 +47,8 @@ egetent() { ;; *) # ignore nscd output if we're not running as root - type -p nscd >/dev/null && nscd -i "${db}" 2>/dev/null - getent "${db}" "${key}" + chroot ${ROOT} type -p nscd >/dev/null && chroot ${EROOT} nscd -i "${db}" 2>/dev/null + chroot ${ROOT} getent "${db}" "${key}" ;; esac } diff --git a/eclass/user.eclass b/eclass/user.eclass index b70698356a..d66b633b07 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -199,7 +199,7 @@ enewuser() { ;; *) - useradd -M -N -r "${opts[@]}" "${euser}" || die + useradd -R ${ROOT} -M -N -r "${opts[@]}" "${euser}" || die ;; esac @@ -305,7 +305,7 @@ enewgroup() { opts="-g ${egid}" fi # We specify -r so that we get a GID in the system range from login.defs - groupadd -r ${opts} "${egroup}" || die + groupadd -R ${ROOT} -r ${opts} "${egroup}" || die ;; esac } @@ -373,7 +373,7 @@ esethome() { ;; *) - usermod -d "${ehome}" "${euser}" && return 0 + usermod -R {ROOT} -d "${ehome}" "${euser}" && return 0 [[ $? == 8 ]] && eerror "${euser} is in use, cannot update home" eerror "There was an error when attempting to update the home directory for ${euser}" eerror "Please update it manually on your system (as root):" @@ -434,7 +434,7 @@ esetshell() { ;; *) - usermod -s "${eshell}" "${euser}" && return 0 + usermod -R ${ROOT} -s "${eshell}" "${euser}" && return 0 [[ $? == 8 ]] && eerror "${euser} is in use, cannot update shell" eerror "There was an error when attempting to update the shell for ${euser}" eerror "Please update it manually on your system (as root):" @@ -490,7 +490,7 @@ esetcomment() { ;; *) - usermod -c "${ecomment}" "${euser}" && return 0 + usermod -R ${ROOT} -c "${ecomment}" "${euser}" && return 0 [[ $? == 8 ]] && eerror "${euser} is in use, cannot update comment" eerror "There was an error when attempting to update the comment for ${euser}" eerror "Please update it manually on your system (as root):" @@ -560,7 +560,7 @@ esetgroups() { ;; *) - usermod "${opts[@]}" "${euser}" && return 0 + usermod -R ${ROOT} "${opts[@]}" "${euser}" && return 0 [[ $? == 8 ]] && eerror "${euser} is in use, cannot update groups" eerror "There was an error when attempting to update the groups for ${euser}" eerror "Please update it manually on your system (as root):"