Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] acct-user.eclass: handle missing path in preinst
Date: Wed, 14 Aug 2019 21:26:11
Message-Id: abfdf743d7f9ea58a698964044b2580933baf782.camel@gentoo.org
In Reply to: [gentoo-dev] [PATCH] acct-user.eclass: handle missing path in preinst by Mike Gilbert
1 On Wed, 2019-08-14 at 17:14 -0400, Mike Gilbert wrote:
2 > Closes: https://bugs.gentoo.org/691478
3 > Signed-off-by: Mike Gilbert <floppym@g.o>
4 > ---
5 > eclass/acct-user.eclass | 5 +++++
6 > 1 file changed, 5 insertions(+)
7 >
8 > diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
9 > index 60009643c144..cec5d0506879 100644
10 > --- a/eclass/acct-user.eclass
11 > +++ b/eclass/acct-user.eclass
12 > @@ -334,6 +334,11 @@ acct-user_pkg_preinst() {
13 > if [[ -z ${ACCT_USER_HOME_OWNER} ]]; then
14 > ACCT_USER_HOME_OWNER=${ACCT_USER_NAME}:${ACCT_USER_GROUPS[0]}
15 > fi
16 > + # Path might be missing due to INSTALL_MASK, etc.
17 > + # https://bugs.gentoo.org/691478
18 > + if [[ ! -e "${ED}/${ACCT_USER_HOME#/}" ]]; then
19 > + keepdir "${ACCT_USER_HOME}"
20 > + fi
21
22 Doesn't it violate the principle of least surprise if you recreate
23 the path that user intentionally wanted stripped?
24
25 > fowners "${ACCT_USER_HOME_OWNER}" "${ACCT_USER_HOME}"
26 > fperms "${ACCT_USER_HOME_PERMS}" "${ACCT_USER_HOME}"
27 > fi
28
29 --
30 Best regards,
31 Michał Górny

Attachments

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

Replies