From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 45900138334 for ; Wed, 14 Aug 2019 21:26:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5C07FE0819; Wed, 14 Aug 2019 21:26:07 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1809CE0806 for ; Wed, 14 Aug 2019 21:26:07 +0000 (UTC) Received: from pomiot (d202-252.icpnet.pl [109.173.202.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 95A8A349B6B; Wed, 14 Aug 2019 21:26:05 +0000 (UTC) Message-ID: Subject: Re: [gentoo-dev] [PATCH] acct-user.eclass: handle missing path in preinst From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Date: Wed, 14 Aug 2019 23:26:01 +0200 In-Reply-To: <20190814211400.58175-1-floppym@gentoo.org> References: <20190814211400.58175-1-floppym@gentoo.org> Organization: Gentoo Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-V36jTXHyEBbWBKnSDR8r" User-Agent: Evolution 3.30.5 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-Archives-Salt: a735a617-c08d-4cab-9aea-d7ba57aa43c9 X-Archives-Hash: c1b01740aad14fd251ab0bbbb2b96782 --=-V36jTXHyEBbWBKnSDR8r Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2019-08-14 at 17:14 -0400, Mike Gilbert wrote: > Closes: https://bugs.gentoo.org/691478 > Signed-off-by: Mike Gilbert > --- > eclass/acct-user.eclass | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass > index 60009643c144..cec5d0506879 100644 > --- a/eclass/acct-user.eclass > +++ b/eclass/acct-user.eclass > @@ -334,6 +334,11 @@ acct-user_pkg_preinst() { > if [[ -z ${ACCT_USER_HOME_OWNER} ]]; then > ACCT_USER_HOME_OWNER=3D${ACCT_USER_NAME}:${ACCT_USER_GROUPS[0]} > fi > + # Path might be missing due to INSTALL_MASK, etc. > + # https://bugs.gentoo.org/691478 > + if [[ ! -e "${ED}/${ACCT_USER_HOME#/}" ]]; then > + keepdir "${ACCT_USER_HOME}" > + fi Doesn't it violate the principle of least surprise if you recreate the path that user intentionally wanted stripped? > fowners "${ACCT_USER_HOME_OWNER}" "${ACCT_USER_HOME}" > fperms "${ACCT_USER_HOME_PERMS}" "${ACCT_USER_HOME}" > fi --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-V36jTXHyEBbWBKnSDR8r Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAl1UfGlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM3 NkE4NDUwOTQwOThEMjhDQzhCMjZDNTYzOUFEQUUyMzI5RTI0MEUACgkQY5ra4jKe JA4NAQgAmZeZfVO/kSbFJY3Ll8gg/vjUBIJmNu6DdQbT0Lkq/X4iSVMuun0EyNwM z99Xrz0VtQvSFWwkRk8T2ziI8Pmpl1q1QoHhJpqCr8xlA/WS901cIux2ONxA5HxV JyaFFYzGiL2VFbSmumuxOLoSS6MpeTeX/KsWo4V+Z9bvLobL+YLDTN8/mVMyA089 3F2hl94TTQ9YCyrC2YSMgB+duz2X+eOwKR4U/fsT/oiYDKwPgzbIhWbtC+lv8GZR FgdCCumJ7aAc9xnE1bO+igSYVTtdGD4FJKDWmpYMoiuHWqzDnxjvXY2xlZ6kUe3p IbL9bMDoW3XRuQrbHLjPYiZ/ibCKkQ== =6XZo -----END PGP SIGNATURE----- --=-V36jTXHyEBbWBKnSDR8r--