From: "Ludovic Courtès" <ludo@gnu.org>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 42983@debbugs.gnu.org
Subject: bug#42983: "sudo -E guix pull" breaks ~/.config/guix/current for regular user
Date: Fri, 28 Aug 2020 15:41:05 +0200 [thread overview]
Message-ID: <87sgc6q45q.fsf@gnu.org> (raw)
In-Reply-To: <20200824021113.71a79f10@scratchpost.org> (Danny Milosavljevic's message of "Mon, 24 Aug 2020 02:11:13 +0200")
Hi Danny,
Danny Milosavljevic <dannym@scratchpost.org> skribis:
> The culprit, I think, is this:
>
> (define (ensure-default-profile)
> (ensure-profile-directory)
>
> ;; In 0.15.0+ we'd create ~/.config/guix/current-[0-9]*-link symlinks. Move
> ;; them to %PROFILE-DIRECTORY.
> ;;
> ;; XXX: Ubuntu's 'sudo' preserves $HOME by default, and thus the second
> ;; condition below is always false when one runs "sudo guix pull". As a
> ;; workaround, skip this code when $SUDO_USER is set. See
> ;; <https://bugs.gnu.org/36785>.
> (unless (or (getenv "SUDO_USER")
> (string=? %profile-directory
> (dirname
> (canonicalize-profile %user-profile-directory))))
> (migrate-generations %user-profile-directory %profile-directory))
>
> where
>
> %profile-directory = "/var/guix/profiles/per-user/dannym"
> %user-profile-directory = "/home/dannym/.config/guix/current" (which is a
> symlink to /var/guix/profiles/per-user/root/current-guix)
We could detect such inconsistencies and emit a warning/hint. I’m
unsure just how far we need to go in trying to prevent users from
shooting themselves in the foot, though. Thoughts?
> Ohh, yeah, sudo without "-E" works fine (sudo guix pull, too).
Yes.
Ludo’.
prev parent reply other threads:[~2020-08-28 13:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-22 10:27 bug#42983: "sudo -E guix pull" breaks ~/.config/guix/current for regular user Danny Milosavljevic
2020-08-22 16:20 ` Bengt Richter
2020-08-23 23:53 ` Danny Milosavljevic
[not found] ` <20200824023829.GA18670@LionPure>
2020-08-25 8:43 ` Danny Milosavljevic
2020-08-22 16:22 ` Leo Famulari
2020-08-23 21:24 ` Danny Milosavljevic
2020-08-23 21:45 ` Leo Famulari
2020-08-24 0:11 ` Danny Milosavljevic
2020-08-28 13:41 ` Ludovic Courtès [this message]
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=87sgc6q45q.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=42983@debbugs.gnu.org \
--cc=dannym@scratchpost.org \
/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).