[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#44623] [PATCH] archive: Warn about replacing an ACL symlink.
From: |
Ludovic Courtès |
Subject: |
[bug#44623] [PATCH] archive: Warn about replacing an ACL symlink. |
Date: |
Sun, 15 Nov 2020 21:50:33 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Tobias Geerinckx-Rice <me@tobias.gr> 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 ‘guix archive --authorize’ would now fail on
Guix System, but indeed it doesn’t, due to the canonical rename trick.
> + ;; 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))))
You can do both at once (thus avoiding a TOCTTOU race) with:
(let ((stat (false-if-exception (lstat %acl-file))))
(when (and stat …)
…))
Otherwise LGTM (for ‘master’), thanks!
Ludo’.