From unknown Wed Aug 20 05:17:53 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#44623 <44623@debbugs.gnu.org> To: bug#44623 <44623@debbugs.gnu.org> Subject: Status: [PATCH] archive: Warn about replacing an ACL symlink. Reply-To: bug#44623 <44623@debbugs.gnu.org> Date: Wed, 20 Aug 2025 12:17:53 +0000 retitle 44623 [PATCH] archive: Warn about replacing an ACL symlink. reassign 44623 guix-patches submitter 44623 Tobias Geerinckx-Rice severity 44623 normal tag 44623 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 13 15:21:05 2020 Received: (at submit) by debbugs.gnu.org; 13 Nov 2020 20:21:06 +0000 Received: from localhost ([127.0.0.1]:49384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdfZB-0007DY-Ka for submit@debbugs.gnu.org; Fri, 13 Nov 2020 15:21:05 -0500 Received: from lists.gnu.org ([209.51.188.17]:57734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdfZ7-0007Cl-57 for submit@debbugs.gnu.org; Fri, 13 Nov 2020 15:21:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdfZ6-0007MH-V9 for guix-patches@gnu.org; Fri, 13 Nov 2020 15:21:00 -0500 Received: from tobias.gr ([2a02:c205:2020:6054::1]:49526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdfZ3-0006Rk-IK for guix-patches@gnu.org; Fri, 13 Nov 2020 15:21:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobias.gr; s=2018; bh=ZhsFcuVtQXMPipUz8Xu6Rcb2kRFGBRtWgVlvtrzzs34=; h=date:subject:to: from; b=mV4wi/FMAaj0Z7K20Pr7jIggTDq+cdj7P5AyJKdXlXNAAkoFZHoxcCC4i9CXQc cRHjYghznaUuW6fSnaX+2nNYTHYfclIjvHo97bc2YZjRzZm4qGzqIZ3kxs9R69o6ec7uLE 2rkp7G92g9IbhITq6EiXHIOjA5f0gBOS+ORox4OQXHuMKChAQjvGVae3TwGeIv7AYXv1Mc 16TyyGwJi0hTPztSakWWyn+KOa3Gm4FYbFwj2FFXy7xNrG4db6gOBs+5ZdLLzsiGqMG88k fD7Cb4mHL7oEwPT65QV7GUGp5OTD6xgblWX0tZPvRL8h4YGwa1Cczr9bO/7wZ7i4/hD0Hw == Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 3d69f3dc (TLSv1.2:ECDHE-ECDSA-AES256-GCM-SHA384:256:NO) for ; Fri, 13 Nov 2020 20:20:57 +0000 (UTC) From: Tobias Geerinckx-Rice To: guix-patches@gnu.org Subject: [PATCH] archive: Warn about replacing an ACL symlink. Date: Fri, 13 Nov 2020 21:20:41 +0100 Message-Id: <20201113202041.2447-1-me@tobias.gr> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a02:c205:2020:6054::1; envelope-from=me@tobias.gr; helo=tobias.gr X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) * guix/scripts/archive.scm (authorize-key): Warn when %ACL-FILE is a symbolic link and print an additional hint for Guix System users. --- guix/scripts/archive.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm index 02557ce454..d284196f41 100644 --- a/guix/scripts/archive.scm +++ b/guix/scripts/archive.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès +;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -310,6 +311,16 @@ the input port." (leave (G_ "failed to read public key: ~a: ~a~%") (error-source err) (error-string err))))) + ;; Warn about potentially volatile ACLs, but continue: system reconfiguration + ;; might not be possible without (newly-authorized) substitutes. + (when (and (access? %acl-file F_OK) + (eq? 'symlink (stat:type (lstat %acl-file)))) + (warning (G_ "replacing symbolic link ~a with a regular file~%") + %acl-file) + (when (string-prefix? (%store-prefix) (readlink %acl-file)) + (display-hint (G_ "On Guix System, add public keys to the +@code{authorized-keys} field of your @code{operating-system} instead.")))) + (let ((key (read-key)) (acl (current-acl))) (unless (eq? 'public-key (canonical-sexp-nth-data key 0)) -- 2.29.2 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 15:50:41 2020 Received: (at 44623) by debbugs.gnu.org; 15 Nov 2020 20:50:41 +0000 Received: from localhost ([127.0.0.1]:54283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keOyv-0005Jt-KZ for submit@debbugs.gnu.org; Sun, 15 Nov 2020 15:50:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keOyu-0005Jf-DJ for 44623@debbugs.gnu.org; Sun, 15 Nov 2020 15:50:40 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47949) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1keOyp-0007wF-3I; Sun, 15 Nov 2020 15:50:35 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45256 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1keOyo-00042l-IJ; Sun, 15 Nov 2020 15:50:34 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Tobias Geerinckx-Rice Subject: Re: [bug#44623] [PATCH] archive: Warn about replacing an ACL symlink. References: <20201113202041.2447-1-me@tobias.gr> Date: Sun, 15 Nov 2020 21:50:33 +0100 In-Reply-To: <20201113202041.2447-1-me@tobias.gr> (Tobias Geerinckx-Rice's message of "Fri, 13 Nov 2020 21:20:41 +0100") Message-ID: <871rgu73ae.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 44623 Cc: 44623@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Tobias Geerinckx-Rice skribis: > * guix/scripts/archive.scm (authorize-key): Warn when %ACL-FILE is a > symbolic link and print an additional hint for Guix System users. Oh, I was convinced that =E2=80=98guix archive --authorize=E2=80=99 would n= ow fail on Guix System, but indeed it doesn=E2=80=99t, due to the canonical rename tri= ck. > + ;; Warn about potentially volatile ACLs, but continue: system reconfig= uration > + ;; might not be possible without (newly-authorized) substitutes. > + (when (and (access? %acl-file F_OK) > + (eq? 'symlink (stat:type (lstat %acl-file)))) You can do both at once (thus avoiding a TOCTTOU race) with: (let ((stat (false-if-exception (lstat %acl-file)))) (when (and stat =E2=80=A6) =E2=80=A6)) Otherwise LGTM (for =E2=80=98master=E2=80=99), thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 17:06:37 2020 Received: (at 44623-done) by debbugs.gnu.org; 15 Nov 2020 22:06:37 +0000 Received: from localhost ([127.0.0.1]:54456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keQAO-0007Mv-Ac for submit@debbugs.gnu.org; Sun, 15 Nov 2020 17:06:37 -0500 Received: from tobias.gr ([80.241.217.52]:42050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keQA7-0007MT-Kx for 44623-done@debbugs.gnu.org; Sun, 15 Nov 2020 17:06:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobias.gr; s=2018; bh=VnPxeV6Y4WgrGrCnxfpPK3lMOeUYld6SMa8ShK6MKJo=; h=date:in-reply-to: references:subject:cc:to:from; b=UApYB9CWUvuWORbxi/WtCpK6aHMRYudLVMLT4 ALI7DIiLWR9ngZ3WpkA9hkKZM4zHlH6c6gAmeYqhjcFK3jV75i90q9k+/pb92Y4A1NAcv4 e+ZQ8FqY9W98w7RJWRXXywigF6FlF0VJwMWfGQJJJGlvF6TTWgPgPxVQ37YJxA2FZzm/5I b1GzHmCCOE8Q/KmKjhggzkba0meoVwmc9Zqgle5LGqOdLaoxe8LK37njDZgSDi9YNnQirn SNNsx4gHKh6IiMhu4m9iaqL3Np/84eqnThjpACJDsqQMP8h5/UNmx45VYC+AHTuKYm145n UisvrhBQW/Qo2/Ojyls474jrQ== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id d6d12f22 (TLSv1.2:ECDHE-ECDSA-AES256-GCM-SHA384:256:NO); Sun, 15 Nov 2020 22:06:23 +0000 (UTC) BIMI-Selector: v=BIMI1; s=default; From: Tobias Geerinckx-Rice To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#44623] [PATCH] archive: Warn about replacing an ACL symlink. References: <20201113202041.2447-1-me@tobias.gr> <871rgu73ae.fsf@gnu.org> In-reply-to: <871rgu73ae.fsf@gnu.org> Date: Sun, 15 Nov 2020 23:06:16 +0100 Message-ID: <87zh3iwa07.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 44623-done Cc: 44623-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s =E5=86=99=E9=81=93=EF=BC=9A > Tobias Geerinckx-Rice skribis: > >> * guix/scripts/archive.scm (authorize-key): Warn when %ACL-FILE=20 >> is a >> symbolic link and print an additional hint for Guix System=20 >> users. > > Oh, I was convinced that =E2=80=98guix archive --authorize=E2=80=99 would= now=20 > fail on > Guix System, but indeed it doesn=E2=80=99t, due to the canonical rename=20 > trick. I don't want it to fail. Just today I used =E2=80=98guix archive --authorize=E2=80=99 so =E2=80=98gu= ix system=20 reconfigure=E2=80=99 (to add the key!) wouldn't take all day. Killer=20 feature! > You can do both at once (thus avoiding a TOCTTOU race) with: That is significantly better. Pushed as=20 5d15733c426d232e98098d99a5bfe145586609a4. Thank you! T G-R --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX7GmWA0cbWVAdG9iaWFz LmdyAAoJEA2w/4hPVW151zMBAPZjPvB4UCkf3psUc8G6iP/+QVFDu2gIC6Enuvr7 ZXC7AQDXlcaseiWWNVJ8PgsFcPsguSyGP1WXUtDABAiQW6nODg== =Mp8s -----END PGP SIGNATURE----- --=-=-=-- From unknown Wed Aug 20 05:17:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 14 Dec 2020 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator