Gentoo Archives: gentoo-dev

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

Attachments

File name MIME type
signature.asc application/pgp-signature