[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] [PATCH 7/9] user.eclass: Use arithmetic test for UID
From:       Ulrich Müller <ulm () gentoo ! org>
Date:       2022-03-27 7:27:33
Message-ID: 20220327072735.9719-8-ulm () gentoo ! org
[Download RAW message or body]

Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
 eclass/user.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/user.eclass b/eclass/user.eclass
index 581704eae815..ff69be81c1ec 100644
--- a/eclass/user.eclass
+++ b/eclass/user.eclass
@@ -85,7 +85,7 @@ user_get_nologin() {
 # If -M is passed, enewuser does not create the home directory if it does not
 # exist.
 enewuser() {
-	if [[ ${EUID} != 0 ]] ; then
+	if [[ ${EUID} -ne 0 ]] ; then
 		ewarn "Insufficient privileges to execute ${FUNCNAME[0]}"
 		return 0
 	fi
@@ -240,7 +240,7 @@ enewuser() {
 # If -F is passed, enewgroup will always enforce specified GID and fail if it
 # can not be assigned.
 enewgroup() {
-	if [[ ${EUID} != 0 ]] ; then
+	if [[ ${EUID} -ne 0 ]] ; then
 		ewarn "Insufficient privileges to execute ${FUNCNAME[0]}"
 		return 0
 	fi
-- 
2.35.1


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic