From 0f558761aa2dee1017b4751e4017205e015a9560 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 29 Jun 2022 12:04:12 +0100 Subject: gentoo resync : 29.12.2022 --- eclass/user.eclass | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'eclass/user.eclass') diff --git a/eclass/user.eclass b/eclass/user.eclass index aab549d0c473..d5b827d2e76b 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -31,12 +31,12 @@ _USER_ECLASS=1 inherit user-info -# @FUNCTION: _assert_pkg_ebuild_phase +# @FUNCTION: _user_assert_pkg_phase # @INTERNAL # @USAGE: # @DESCRIPTION: # Raises an alert if the phase is not suitable for user.eclass usage. -_assert_pkg_ebuild_phase() { +_user_assert_pkg_phase() { case ${EBUILD_PHASE} in setup|preinst|postinst|prerm|postrm) ;; *) @@ -89,7 +89,7 @@ enewuser() { ewarn "Insufficient privileges to execute ${FUNCNAME[0]}" return 0 fi - _assert_pkg_ebuild_phase ${FUNCNAME} + _user_assert_pkg_phase ${FUNCNAME} local create_home=1 force_uid= while [[ ${1} == -* ]]; do @@ -123,13 +123,13 @@ enewuser() { # handle uid local euid=${1}; shift if [[ -n ${euid} && ${euid} != -1 ]] ; then - if [[ ${euid} -gt 0 ]] ; then + if [[ ${euid} -ge 0 ]] ; then if [[ -n $(egetent passwd ${euid}) ]] ; then [[ -n ${force_uid} ]] && die "${FUNCNAME}: UID ${euid} already taken" euid="next" fi else - eerror "Userid given but is not greater than 0!" + eerror "Userid given but is not greater than or equal to 0!" die "${euid} is not a valid UID" fi else @@ -262,7 +262,7 @@ enewgroup() { ewarn "Insufficient privileges to execute ${FUNCNAME[0]}" return 0 fi - _assert_pkg_ebuild_phase ${FUNCNAME} + _user_assert_pkg_phase ${FUNCNAME} local force_gid= while [[ ${1} == -* ]]; do @@ -289,13 +289,13 @@ enewgroup() { # handle gid local egid=${1}; shift if [[ -n ${egid} && ${egid} != -1 ]] ; then - if [[ ${egid} -gt 0 ]] ; then + if [[ ${egid} -ge 0 ]] ; then if [[ -n $(egetent group ${egid}) ]] ; then [[ -n ${force_gid} ]] && die "${FUNCNAME}: GID ${egid} already taken" egid="next available; requested gid taken" fi else - eerror "Groupid given but is not greater than 0!" + eerror "Groupid given but is not greater than or equal to 0!" die "${egid} is not a valid GID" fi else @@ -365,7 +365,7 @@ enewgroup() { # If the new home directory does not exist, it is created. # Any previously existing home directory is NOT moved. esethome() { - _assert_pkg_ebuild_phase ${FUNCNAME} + _user_assert_pkg_phase ${FUNCNAME} # get the username local euser=${1}; shift @@ -451,7 +451,7 @@ esethome() { # Required parameters is the username and the new shell. # Specify -1 if you want to set shell to platform-specific nologin. esetshell() { - _assert_pkg_ebuild_phase ${FUNCNAME} + _user_assert_pkg_phase ${FUNCNAME} # get the username local euser=${1}; shift @@ -528,7 +528,7 @@ esetshell() { # Update the comment field in a platform-agnostic way. # Required parameters is the username and the new comment. esetcomment() { - _assert_pkg_ebuild_phase ${FUNCNAME} + _user_assert_pkg_phase ${FUNCNAME} # get the username local euser=${1}; shift @@ -602,7 +602,7 @@ esetcomment() { # Required parameters is the username and the new list of groups, # primary group first. esetgroups() { - _assert_pkg_ebuild_phase ${FUNCNAME} + _user_assert_pkg_phase ${FUNCNAME} [[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} " -- cgit v1.2.3