Gentoo Archives: gentoo-dev

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-dev@l.g.o
Cc: "Ulrich Müller" <ulm@g.o>
Subject: [gentoo-dev] [PATCH 7/9] user.eclass: Use arithmetic test for UID
Date: Sun, 27 Mar 2022 07:30:11
Message-Id: 20220327072735.9719-8-ulm@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/9] eclass: Use UID 0 instead of root and other fixes by "Ulrich Müller"
1 Signed-off-by: Ulrich Müller <ulm@g.o>
2 ---
3 eclass/user.eclass | 4 ++--
4 1 file changed, 2 insertions(+), 2 deletions(-)
5
6 diff --git a/eclass/user.eclass b/eclass/user.eclass
7 index 581704eae815..ff69be81c1ec 100644
8 --- a/eclass/user.eclass
9 +++ b/eclass/user.eclass
10 @@ -85,7 +85,7 @@ user_get_nologin() {
11 # If -M is passed, enewuser does not create the home directory if it does not
12 # exist.
13 enewuser() {
14 - if [[ ${EUID} != 0 ]] ; then
15 + if [[ ${EUID} -ne 0 ]] ; then
16 ewarn "Insufficient privileges to execute ${FUNCNAME[0]}"
17 return 0
18 fi
19 @@ -240,7 +240,7 @@ enewuser() {
20 # If -F is passed, enewgroup will always enforce specified GID and fail if it
21 # can not be assigned.
22 enewgroup() {
23 - if [[ ${EUID} != 0 ]] ; then
24 + if [[ ${EUID} -ne 0 ]] ; then
25 ewarn "Insufficient privileges to execute ${FUNCNAME[0]}"
26 return 0
27 fi
28 --
29 2.35.1