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 8/9] acct-user.eclass: Use arithmetic test for EUID
Date: Sun, 27 Mar 2022 07:30:30
Message-Id: 20220327072735.9719-9-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/acct-user.eclass | 12 ++++++------
4 1 file changed, 6 insertions(+), 6 deletions(-)
5
6 diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
7 index 70ae2434b5df..2e2e1152f9ad 100644
8 --- a/eclass/acct-user.eclass
9 +++ b/eclass/acct-user.eclass
10 @@ -1,4 +1,4 @@
11 -# Copyright 2019-2021 Gentoo Authors
12 +# Copyright 2019-2022 Gentoo Authors
13 # Distributed under the terms of the GNU General Public License v2
14
15 # @ECLASS: acct-user.eclass
16 @@ -178,7 +178,7 @@ acct-user_add_deps() {
17 eislocked() {
18 [[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
19
20 - if [[ ${EUID} != 0 ]]; then
21 + if [[ ${EUID} -ne 0 ]]; then
22 einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
23 return 0
24 fi
25 @@ -215,7 +215,7 @@ eislocked() {
26 elockuser() {
27 [[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
28
29 - if [[ ${EUID} != 0 ]]; then
30 + if [[ ${EUID} -ne 0 ]]; then
31 einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
32 return 0
33 fi
34 @@ -258,7 +258,7 @@ elockuser() {
35 eunlockuser() {
36 [[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
37
38 - if [[ ${EUID} != 0 ]]; then
39 + if [[ ${EUID} -ne 0 ]]; then
40 einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
41 return 0
42 fi
43 @@ -440,7 +440,7 @@ acct-user_pkg_preinst() {
44 acct-user_pkg_postinst() {
45 debug-print-function ${FUNCNAME} "${@}"
46
47 - if [[ ${EUID} != 0 ]]; then
48 + if [[ ${EUID} -ne 0 ]]; then
49 einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
50 return 0
51 fi
52 @@ -468,7 +468,7 @@ acct-user_pkg_postinst() {
53 acct-user_pkg_prerm() {
54 debug-print-function ${FUNCNAME} "${@}"
55
56 - if [[ ${EUID} != 0 ]]; then
57 + if [[ ${EUID} -ne 0 ]]; then
58 einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
59 return 0
60 fi
61 --
62 2.35.1