From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MDuAD0j7mWOGDgAAbAwnHQ (envelope-from ) for ; Wed, 14 Dec 2022 17:35:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id ONg1D0j7mWN9QwAAauVa8A (envelope-from ) for ; Wed, 14 Dec 2022 17:35:20 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B81E43A408 for ; Wed, 14 Dec 2022 17:35:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5Uiw-0000VK-4H; Wed, 14 Dec 2022 11:35:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5Uik-0000Uk-Aj for guix-patches@gnu.org; Wed, 14 Dec 2022 11:35:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5Uik-0005al-2b for guix-patches@gnu.org; Wed, 14 Dec 2022 11:35:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5Uij-0004z0-P0 for guix-patches@gnu.org; Wed, 14 Dec 2022 11:35:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60068] [PATCH 1/2] guix-install.sh: Add GUIX_ALLOW_OVERWRITE environment variable. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 14 Dec 2022 16:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60068 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 60068@debbugs.gnu.org X-Debbugs-Original-Cc: 60068@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by 60068-submit@debbugs.gnu.org id=B60068.167103569919139 (code B ref 60068); Wed, 14 Dec 2022 16:35:01 +0000 Received: (at 60068) by debbugs.gnu.org; 14 Dec 2022 16:34:59 +0000 Received: from localhost ([127.0.0.1]:40238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5Uig-0004yd-TL for submit@debbugs.gnu.org; Wed, 14 Dec 2022 11:34:59 -0500 Received: from tobias.gr ([80.241.217.52]:55566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5Uid-0004yX-3b for 60068@debbugs.gnu.org; Wed, 14 Dec 2022 11:34:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=aUn/po7Ll9Pe9 CYGKOK7D4ZgNZjc9oqcBJETlzXaLFU=; h=in-reply-to:date:subject:cc:to: from:references; d=tobias.gr; b=ap8aGhr9j+KqO0xdPQNLulZ0FSuUHUUq9Vp3Do RB0I6t7L6UYziIHqgeIowJa7u2j07qPmT8Eg7gVFQnni0kccDfEiLBW504y+uW9+o+Ia0s 9oDD9T6jtP4b0VCJz6V8vwxIz30UBBE8PO5cHzWEqPJ8eBwfSFEl7A2QWaUQ4ngqpfQFn7 NcmFdu+IG66l5ybPh0tpdyytnzJ3czOk5Jw08vg6XrqGBIEe+bw6cOImLFLDmM8vaSgtJG ecMWp3nNse7n+91DR1MJPi9OmlDcoRfX+eELLyGocghdEcb9aZNv4hQDkff8LgoSpr/dJ4 WSzvR/Lokl/zr4oyLTGyr0TA== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id a8987525 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Wed, 14 Dec 2022 16:34:50 +0000 (UTC) References: <20221214155603.29381-1-maxim.cournoyer@gmail.com> Date: Wed, 14 Dec 2022 17:16:19 +0100 In-reply-to: <20221214155603.29381-1-maxim.cournoyer@gmail.com> BIMI-Selector: v=BIMI1; s=default; Message-ID: <875yeec57z.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches From: Tobias Geerinckx-Rice via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671035720; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=aUn/po7Ll9Pe9CYGKOK7D4ZgNZjc9oqcBJETlzXaLFU=; b=haZBI3vmvEjXZH6YkxUkOXz4vPoKOZWR2cpYRsdRzwLcJ0uS9EDkEteO95erwiTOsh67bZ BVe7mG60Ki2Ms6fSQtlJsTw2dqVZZuBxZvn7ygzjSkorTCXYc6Tc01SOjfeIrKJ80KgKI3 5xbGz7mNoXfFLCY7uxRoBtGedejzmgvHSEHSFaYTbyTB/tHy8SHVbVAfk4SiVKUU8kTWlW CoAbrNEvFC5UVMbf5WcEqYZklFxqH7jkpFVJgR68iyp3z0XS6xhMcUnIqjgrilSkEB+Nx2 Dv8KB9yY9CQEh7EYaL1kpiTLOoUfDqXrymgx4qCuu6w5oDYWzUTVKnNwLPigBg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=ap8aGhr9; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671035720; a=rsa-sha256; cv=none; b=HPpfu4AHmVC0wBi2gL5mb8iaNZqqn/IEim/XkQa4UGLm0kmnhDs6xzopBNpmZB8fxzpyIa gjZqjN4nUang5+gMawT7AsxTXfDGBfTRH9RjmmILnrVSmvSn/oCAF5zf2LygJ1EP/8PSM4 FFzviXWoCA24iBVAQqCiKQfGb8Wy1QsbWJq0U9cjn9fHzgqtFSrgywhUa2EVxSUBQ/s2Fe Co945XU1YjZTshuRnmKAgzAE1MWlafHrhVEvM1d1nzGgc57dVvOBlppiuqEKTRlbcpWVJz hsPv01IQmmTHeKSOMo6pYRuNF5hyOoRrq6yPk+vEkENCC3xPWoLWE+rhwOV2Mw== X-Migadu-Spam-Score: -5.07 X-Spam-Score: -5.07 X-Migadu-Queue-Id: B81E43A408 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=ap8aGhr9; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-TUID: +aN+hVjnAJvW --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Maxim, Nice! More steps towards world domination. Maxim Cournoyer =E5=86=99=E9=81=93=EF=BC=9A > +# Environment variables These sound like they should be command-line arguments. [=E2=80=A6] Actually, I'm not totally sold on GUIX_ALLOW_OVERWRITE. It's not=20 solving much a problem. Instead, the error message could be specific about what it=20 considers a =E2=80=98previous Guix installation=E2=80=99 =E2=80=94 which wo= uld be a good=20 idea regardless =E2=80=94 and tell the admin exactly what needs to be=20 removed to continue. > "groupadd" > + "useradd" Good catch, but separate patch. (=E2=99=AA) > - if [[ -e "/var/guix" || -e "/gnu" ]]; then > + if [[ -z $GUIX_ALLOW_OVERWRITE && (-e /var/guix || -e /gnu)=20 > ]]; then > die "A previous Guix installation was found. Refusing=20 > to overwrite." > + else > + _msg "${WAR}Overwriting existing installation!" > fi >=20=20 > cd "$tmp_path" > - tar --extract --file "$pkg" && _msg "${PAS}unpacked=20 > archive" > - > _msg "${INF}Installing /var/guix and /gnu..." > - mv "${tmp_path}/var/guix" /var/ > - mv "${tmp_path}/gnu" / > + tar --extract --file "$pkg" -C / I'm still in favour of using something like =E2=80=98mktemp -d=20 /gnu.XXXXXX=E2=80=99 here if there's no security flaw I missed. WDYT? If the overwrite functionality is kept, we should remove the old=20 directories before re-populating them. Kind regards, T G-R --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCY5n7kA0cbWVAdG9iaWFz LmdyAAoJEA2w/4hPVW15JYQA/0MC+9Nq+MATmo1+I6w6hw1wcCsFaUR5bzjr3DyO vmKWAP9ZPyqhLEYgIENx0DPBEz0p8zLD2G/yx5gCCHWgFyEmAA== =++lV -----END PGP SIGNATURE----- --=-=-=--