From: Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org>
To: 44623@debbugs.gnu.org
Subject: [bug#44623] [PATCH] archive: Warn about replacing an ACL symlink.
Date: Fri, 13 Nov 2020 21:20:41 +0100 [thread overview]
Message-ID: <20201113202041.2447-1-me@tobias.gr> (raw)
* 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 <ludo@gnu.org>
+;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; 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
next reply other threads:[~2020-11-13 20:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 20:20 Tobias Geerinckx-Rice via Guix-patches via [this message]
2020-11-15 20:50 ` [bug#44623] [PATCH] archive: Warn about replacing an ACL symlink Ludovic Courtès
2020-11-15 22:06 ` bug#44623: " Tobias Geerinckx-Rice via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201113202041.2447-1-me@tobias.gr \
--to=guix-patches@gnu.org \
--cc=44623@debbugs.gnu.org \
--cc=me@tobias.gr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).