Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: James Le Cuirot <chewi@g.o>
Subject: Re: [gentoo-dev] [PATCH 1/2] acct-group.eclass: Don't modify groups when EPREFIX is non-empty
Date: Fri, 09 Dec 2022 04:23:14
Message-Id: fe50435fb6c8c39eff8665a0b783047e28f52a6d.camel@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/2] acct-group.eclass: Don't modify groups when EPREFIX is non-empty by James Le Cuirot
1 On Thu, 2022-12-08 at 21:28 +0000, James Le Cuirot wrote:
2 > This was happening when running a prefix as root, which we don't really
3 > support, but also when building a prefixed system under ROOT.
4 >
5 > Closes: https://bugs.gentoo.org/779181
6 > Signed-off-by: James Le Cuirot <chewi@g.o>
7 > ---
8 > eclass/acct-group.eclass | 2 +-
9 > 1 file changed, 1 insertion(+), 1 deletion(-)
10 >
11 > diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
12 > index 590a2f20ed8e..f55c9f4c9587 100644
13 > --- a/eclass/acct-group.eclass
14 > +++ b/eclass/acct-group.eclass
15 > @@ -157,7 +157,7 @@ acct-group_src_install() {
16 > acct-group_pkg_preinst() {
17 > debug-print-function ${FUNCNAME} "${@}"
18 >
19 > - if [[ ${EUID} -ne 0 ]]; then
20 > + if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
21 > einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
22 > return
23 > fi
24
25 I dare say the message is not necessarily correct here but I suppose it
26 doesn't matter that much.
27
28 --
29 Best regards,
30 Michał Górny

Replies