public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] acct-user.eclass: ignore missing directory in preinst
@ 2019-08-14 23:54 Mike Gilbert
  2019-08-15  6:04 ` Michał Górny
  2019-08-15  7:19 ` Ulrich Mueller
  0 siblings, 2 replies; 6+ messages in thread
From: Mike Gilbert @ 2019-08-14 23:54 UTC (permalink / raw
  To: gentoo-dev

Closes: https://bugs.gentoo.org/691478
---
 eclass/acct-user.eclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index 60009643c144..077f85417ce8 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -334,8 +334,12 @@ acct-user_pkg_preinst() {
 		if [[ -z ${ACCT_USER_HOME_OWNER} ]]; then
 			ACCT_USER_HOME_OWNER=${ACCT_USER_NAME}:${ACCT_USER_GROUPS[0]}
 		fi
-		fowners "${ACCT_USER_HOME_OWNER}" "${ACCT_USER_HOME}"
-		fperms "${ACCT_USER_HOME_PERMS}" "${ACCT_USER_HOME}"
+		# Path might be missing due to INSTALL_MASK, etc.
+		# https://bugs.gentoo.org/691478
+		if [[ -e "${ED}/${ACCT_USER_HOME#/}" ]]; then
+			fowners "${ACCT_USER_HOME_OWNER}" "${ACCT_USER_HOME}"
+			fperms "${ACCT_USER_HOME_PERMS}" "${ACCT_USER_HOME}"
+		fi
 	fi
 }
 
-- 
2.23.0.rc1



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

* Re: [gentoo-dev] [PATCH] acct-user.eclass: ignore missing directory in preinst
  2019-08-14 23:54 [gentoo-dev] [PATCH] acct-user.eclass: ignore missing directory in preinst Mike Gilbert
@ 2019-08-15  6:04 ` Michał Górny
  2019-08-15  7:19 ` Ulrich Mueller
  1 sibling, 0 replies; 6+ messages in thread
From: Michał Górny @ 2019-08-15  6:04 UTC (permalink / raw
  To: gentoo-dev

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

On Wed, 2019-08-14 at 19:54 -0400, Mike Gilbert wrote:
> Closes: https://bugs.gentoo.org/691478
> ---
>  eclass/acct-user.eclass | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
> index 60009643c144..077f85417ce8 100644
> --- a/eclass/acct-user.eclass
> +++ b/eclass/acct-user.eclass
> @@ -334,8 +334,12 @@ acct-user_pkg_preinst() {
>  		if [[ -z ${ACCT_USER_HOME_OWNER} ]]; then
>  			ACCT_USER_HOME_OWNER=${ACCT_USER_NAME}:${ACCT_USER_GROUPS[0]}
>  		fi
> -		fowners "${ACCT_USER_HOME_OWNER}" "${ACCT_USER_HOME}"
> -		fperms "${ACCT_USER_HOME_PERMS}" "${ACCT_USER_HOME}"
> +		# Path might be missing due to INSTALL_MASK, etc.
> +		# https://bugs.gentoo.org/691478
> +		if [[ -e "${ED}/${ACCT_USER_HOME#/}" ]]; then
> +			fowners "${ACCT_USER_HOME_OWNER}" "${ACCT_USER_HOME}"
> +			fperms "${ACCT_USER_HOME_PERMS}" "${ACCT_USER_HOME}"
> +		fi
>  	fi
>  }
>  

LGTM.

-- 
Best regards,
Michał Górny


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

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

* Re: [gentoo-dev] [PATCH] acct-user.eclass: ignore missing directory in preinst
  2019-08-14 23:54 [gentoo-dev] [PATCH] acct-user.eclass: ignore missing directory in preinst Mike Gilbert
  2019-08-15  6:04 ` Michał Górny
@ 2019-08-15  7:19 ` Ulrich Mueller
  2019-08-15 12:33   ` Michael Orlitzky
  1 sibling, 1 reply; 6+ messages in thread
From: Ulrich Mueller @ 2019-08-15  7:19 UTC (permalink / raw
  To: Mike Gilbert; +Cc: gentoo-dev

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

>>>>> On Thu, 15 Aug 2019, Mike Gilbert wrote:

> +		# Path might be missing due to INSTALL_MASK, etc.
> +		# https://bugs.gentoo.org/691478
> +		if [[ -e "${ED}/${ACCT_USER_HOME#/}" ]]; then
> +			fowners "${ACCT_USER_HOME_OWNER}" "${ACCT_USER_HOME}"
> +			fperms "${ACCT_USER_HOME_PERMS}" "${ACCT_USER_HOME}"
> +		fi

IIUC, this would result in an entry for the directory in /etc/passwd,
but the directory wouldn't exist on the system?

I don't think that's a sane situation, so maybe the eclass should just
die here? (Basically, there are two possibilities: Either, things will
break if the dir is missing, then dying might be the best option.
Or, everything works without the dir, then the ebuild should set it to
/dev/null, in the first place.)

Ulrich

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: [gentoo-dev] [PATCH] acct-user.eclass: ignore missing directory in preinst
  2019-08-15  7:19 ` Ulrich Mueller
@ 2019-08-15 12:33   ` Michael Orlitzky
  2019-08-15 14:47     ` Mike Gilbert
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Orlitzky @ 2019-08-15 12:33 UTC (permalink / raw
  To: gentoo-dev

On 8/15/19 3:19 AM, Ulrich Mueller wrote:
> 
> I don't think that's a sane situation, so maybe the eclass should just
> die here? (Basically, there are two possibilities: Either, things will
> break if the dir is missing, then dying might be the best option.
> Or, everything works without the dir, then the ebuild should set it to
> /dev/null, in the first place.)
> 

That's my feeling as well. In 100% of cases so far, this has been a
useful QA tool. Can we wait until that's not the case to change it?


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

* Re: [gentoo-dev] [PATCH] acct-user.eclass: ignore missing directory in preinst
  2019-08-15 12:33   ` Michael Orlitzky
@ 2019-08-15 14:47     ` Mike Gilbert
  2019-08-16  9:24       ` Jaco Kroon
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Gilbert @ 2019-08-15 14:47 UTC (permalink / raw
  To: Gentoo Dev

On Thu, Aug 15, 2019 at 8:33 AM Michael Orlitzky <mjo@gentoo.org> wrote:
>
> On 8/15/19 3:19 AM, Ulrich Mueller wrote:
> >
> > I don't think that's a sane situation, so maybe the eclass should just
> > die here? (Basically, there are two possibilities: Either, things will
> > break if the dir is missing, then dying might be the best option.
> > Or, everything works without the dir, then the ebuild should set it to
> > /dev/null, in the first place.)
> >
>
> That's my feeling as well. In 100% of cases so far, this has been a
> useful QA tool. Can we wait until that's not the case to change it?

I think an explicit die with a useful error message for the user would
be better than the status-quo.


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

* Re: [gentoo-dev] [PATCH] acct-user.eclass: ignore missing directory in preinst
  2019-08-15 14:47     ` Mike Gilbert
@ 2019-08-16  9:24       ` Jaco Kroon
  0 siblings, 0 replies; 6+ messages in thread
From: Jaco Kroon @ 2019-08-16  9:24 UTC (permalink / raw
  To: gentoo-dev, Mike Gilbert

Hi,

On 2019/08/15 16:47, Mike Gilbert wrote:

> On Thu, Aug 15, 2019 at 8:33 AM Michael Orlitzky <mjo@gentoo.org> wrote:
>> On 8/15/19 3:19 AM, Ulrich Mueller wrote:
>>> I don't think that's a sane situation, so maybe the eclass should just
>>> die here? (Basically, there are two possibilities: Either, things will
>>> break if the dir is missing, then dying might be the best option.
>>> Or, everything works without the dir, then the ebuild should set it to
>>> /dev/null, in the first place.)
>>>
>> That's my feeling as well. In 100% of cases so far, this has been a
>> useful QA tool. Can we wait until that's not the case to change it?
> I think an explicit die with a useful error message for the user would
> be better than the status-quo.

I agree.


Kind Regards,
Jaco



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

end of thread, other threads:[~2019-08-16  9:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-14 23:54 [gentoo-dev] [PATCH] acct-user.eclass: ignore missing directory in preinst Mike Gilbert
2019-08-15  6:04 ` Michał Górny
2019-08-15  7:19 ` Ulrich Mueller
2019-08-15 12:33   ` Michael Orlitzky
2019-08-15 14:47     ` Mike Gilbert
2019-08-16  9:24       ` Jaco Kroon

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