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 E99EF138334 for ; Wed, 14 Aug 2019 21:38:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 951C8E081B; Wed, 14 Aug 2019 21:38:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 32080E0798 for ; Wed, 14 Aug 2019 21:38:20 +0000 (UTC) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id 090B2349B6B for ; Wed, 14 Aug 2019 21:38:19 +0000 (UTC) Received: by mail-ot1-f47.google.com with SMTP id j7so1479080ota.9 for ; Wed, 14 Aug 2019 14:38:19 -0700 (PDT) X-Gm-Message-State: APjAAAWv6V289y5s3/lR57rgWG4XYyHKAe3arI5E1c3CNUvmxt8LpK0b aqWx9ggvrQcPnpeoLjMxcEkTvFqYCGz82WE89f4= X-Google-Smtp-Source: APXvYqxXL9GIBq5dWJ4IXRip4KlZW4c82tvDVKw/6r8U6RaOiVCqyigzPkgdYG8I4ti0QyEfXMhZqxB6Dr+DJiEdDLI= X-Received: by 2002:a5d:9583:: with SMTP id a3mr2083737ioo.54.1565818697071; Wed, 14 Aug 2019 14:38:17 -0700 (PDT) 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 References: <20190814211400.58175-1-floppym@gentoo.org> In-Reply-To: From: Mike Gilbert Date: Wed, 14 Aug 2019 17:38:05 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-dev] [PATCH] acct-user.eclass: handle missing path in preinst To: Gentoo Dev Content-Type: multipart/alternative; boundary="00000000000038ca2d05901a938a" X-Archives-Salt: 1f1b54ef-f215-4cfa-a801-6f004c0a0da2 X-Archives-Hash: 4163438c8fb32b69bf0221618093e07a --00000000000038ca2d05901a938a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Aug 14, 2019, 5:26 PM Micha=C5=82 G=C3=B3rny wr= ote: > 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(+) > > > > 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 > > -- > Best regards, > Micha=C5=82 G=C3=B3rny > I was debating that with myself after I sent this. I suppose we could just skip it if it is missing. > --00000000000038ca2d05901a938a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Aug 14, 2019, 5:26 PM Micha=C5=82 G=C3=B3rny <mgorny@gentoo.org> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">On Wed, 2019-08-14 at 17:14 -0400, Mike Gilbe= rt wrote:
> Closes: https://bugs.gentoo.org/691478
> Signed-off-by: Mike Gilbert <floppym@gentoo.org>
> ---
>=C2=A0 eclass/acct-user.eclass | 5 +++++
>=C2=A0 1 file changed, 5 insertions(+)
>
> 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() {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if [[ -z ${ACCT_= USER_HOME_OWNER} ]]; then
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0ACCT_USER_HOME_OWNER=3D${ACCT_USER_NAME}:${ACCT_USER_GROUPS[0]= }
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fi
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Path might be missi= ng due to INSTALL_MASK, etc.
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# htt= ps://bugs.gentoo.org/691478
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if [[ ! -e "${ED= }/${ACCT_USER_HOME#/}" ]]; then
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0keepdir "${ACCT_USER_HOME}"
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fi

Doesn't it violate the principle of least surprise if you recreate
the path that user intentionally wanted stripped?

>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fowners "${= ACCT_USER_HOME_OWNER}" "${ACCT_USER_HOME}"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fperms "${A= CCT_USER_HOME_PERMS}" "${ACCT_USER_HOME}"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0fi

--
Best regards,
Micha=C5=82 G=C3=B3rny

I was debating that with myself after I sent this. I = suppose we could just skip it if it is missing.=C2=A0
--00000000000038ca2d05901a938a--