public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] acct-*.eclass: Don't modify users/groups when EPREFIX is non-empty
@ 2022-12-08 21:28 James Le Cuirot
  2022-12-08 21:28 ` [gentoo-dev] [PATCH 1/2] acct-group.eclass: Don't modify groups " James Le Cuirot
  2022-12-08 21:28 ` [gentoo-dev] [PATCH 2/2] acct-user.eclass: Don't modify users " James Le Cuirot
  0 siblings, 2 replies; 5+ messages in thread
From: James Le Cuirot @ 2022-12-08 21:28 UTC (permalink / raw
  To: gentoo-dev

This was happening when running a prefix as root, which we don't really
support, but also when building a prefixed system under ROOT.

Bug #779181 suggested a variable to optionally permit this, but no one cares
enough to make it work at present. I just want to fix the failures when building
under ROOT.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gentoo-dev] [PATCH 1/2] acct-group.eclass: Don't modify groups when EPREFIX is non-empty
  2022-12-08 21:28 [gentoo-dev] acct-*.eclass: Don't modify users/groups when EPREFIX is non-empty James Le Cuirot
@ 2022-12-08 21:28 ` James Le Cuirot
  2022-12-09  4:23   ` Michał Górny
  2022-12-08 21:28 ` [gentoo-dev] [PATCH 2/2] acct-user.eclass: Don't modify users " James Le Cuirot
  1 sibling, 1 reply; 5+ messages in thread
From: James Le Cuirot @ 2022-12-08 21:28 UTC (permalink / raw
  To: gentoo-dev; +Cc: James Le Cuirot

This was happening when running a prefix as root, which we don't really
support, but also when building a prefixed system under ROOT.

Closes: https://bugs.gentoo.org/779181
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
---
 eclass/acct-group.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
index 590a2f20ed8e..f55c9f4c9587 100644
--- a/eclass/acct-group.eclass
+++ b/eclass/acct-group.eclass
@@ -157,7 +157,7 @@ acct-group_src_install() {
 acct-group_pkg_preinst() {
 	debug-print-function ${FUNCNAME} "${@}"
 
-	if [[ ${EUID} -ne 0 ]]; then
+	if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
 		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
 		return
 	fi
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-dev] [PATCH 2/2] acct-user.eclass: Don't modify users when EPREFIX is non-empty
  2022-12-08 21:28 [gentoo-dev] acct-*.eclass: Don't modify users/groups when EPREFIX is non-empty James Le Cuirot
  2022-12-08 21:28 ` [gentoo-dev] [PATCH 1/2] acct-group.eclass: Don't modify groups " James Le Cuirot
@ 2022-12-08 21:28 ` James Le Cuirot
  1 sibling, 0 replies; 5+ messages in thread
From: James Le Cuirot @ 2022-12-08 21:28 UTC (permalink / raw
  To: gentoo-dev; +Cc: James Le Cuirot

This was happening when running a prefix as root, which we don't really
support, but also when building a prefixed system under ROOT.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
---
 eclass/acct-user.eclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index b15599c5dd6f..a37e12121f83 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -181,7 +181,7 @@ acct-user_add_deps() {
 eislocked() {
 	[[ $# -eq 1 ]] || die "usage: ${FUNCNAME} <user>"
 
-	if [[ ${EUID} -ne 0 ]]; then
+	if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
 		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
 		return 0
 	fi
@@ -332,7 +332,7 @@ acct-user_pkg_preinst() {
 
 	unset _ACCT_USER_ADDED
 
-	if [[ ${EUID} -ne 0 ]]; then
+	if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
 		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
 		return
 	fi
@@ -405,7 +405,7 @@ acct-user_pkg_postinst() {
 		return
 	fi
 
-	if [[ ${EUID} -ne 0 ]]; then
+	if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
 		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
 		return
 	fi
@@ -454,7 +454,7 @@ acct-user_pkg_prerm() {
 		return
 	fi
 
-	if [[ ${EUID} -ne 0 ]]; then
+	if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
 		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
 		return
 	fi
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] acct-group.eclass: Don't modify groups when EPREFIX is non-empty
  2022-12-08 21:28 ` [gentoo-dev] [PATCH 1/2] acct-group.eclass: Don't modify groups " James Le Cuirot
@ 2022-12-09  4:23   ` Michał Górny
  2022-12-09 11:13     ` James Le Cuirot
  0 siblings, 1 reply; 5+ messages in thread
From: Michał Górny @ 2022-12-09  4:23 UTC (permalink / raw
  To: gentoo-dev; +Cc: James Le Cuirot

On Thu, 2022-12-08 at 21:28 +0000, James Le Cuirot wrote:
> This was happening when running a prefix as root, which we don't really
> support, but also when building a prefixed system under ROOT.
> 
> Closes: https://bugs.gentoo.org/779181
> Signed-off-by: James Le Cuirot <chewi@gentoo.org>
> ---
>  eclass/acct-group.eclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
> index 590a2f20ed8e..f55c9f4c9587 100644
> --- a/eclass/acct-group.eclass
> +++ b/eclass/acct-group.eclass
> @@ -157,7 +157,7 @@ acct-group_src_install() {
>  acct-group_pkg_preinst() {
>  	debug-print-function ${FUNCNAME} "${@}"
>  
> -	if [[ ${EUID} -ne 0 ]]; then
> +	if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
>  		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
>  		return
>  	fi

I dare say the message is not necessarily correct here but I suppose it
doesn't matter that much.

-- 
Best regards,
Michał Górny



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] acct-group.eclass: Don't modify groups when EPREFIX is non-empty
  2022-12-09  4:23   ` Michał Górny
@ 2022-12-09 11:13     ` James Le Cuirot
  0 siblings, 0 replies; 5+ messages in thread
From: James Le Cuirot @ 2022-12-09 11:13 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1155 bytes --]

On Fri, 2022-12-09 at 05:23 +0100, Michał Górny wrote:
> On Thu, 2022-12-08 at 21:28 +0000, James Le Cuirot wrote:
> > This was happening when running a prefix as root, which we don't really
> > support, but also when building a prefixed system under ROOT.
> > 
> > Closes: https://bugs.gentoo.org/779181
> > Signed-off-by: James Le Cuirot <chewi@gentoo.org>
> > ---
> >  eclass/acct-group.eclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
> > index 590a2f20ed8e..f55c9f4c9587 100644
> > --- a/eclass/acct-group.eclass
> > +++ b/eclass/acct-group.eclass
> > @@ -157,7 +157,7 @@ acct-group_src_install() {
> >  acct-group_pkg_preinst() {
> >  	debug-print-function ${FUNCNAME} "${@}"
> >  
> > -	if [[ ${EUID} -ne 0 ]]; then
> > +	if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
> >  		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
> >  		return
> >  	fi
> 
> I dare say the message is not necessarily correct here but I suppose it
> doesn't matter that much.

Yeah, I thought that too, but not enough for such a corner case.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 858 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-09 11:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-08 21:28 [gentoo-dev] acct-*.eclass: Don't modify users/groups when EPREFIX is non-empty James Le Cuirot
2022-12-08 21:28 ` [gentoo-dev] [PATCH 1/2] acct-group.eclass: Don't modify groups " James Le Cuirot
2022-12-09  4:23   ` Michał Górny
2022-12-09 11:13     ` James Le Cuirot
2022-12-08 21:28 ` [gentoo-dev] [PATCH 2/2] acct-user.eclass: Don't modify users " James Le Cuirot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox