guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ‘sudo’ leaves PATH unchanged… so what?


From: Ludovic Courtès
Subject: Re: ‘sudo’ leaves PATH unchanged… so what?
Date: Sat, 19 Jan 2019 23:52:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hey,

Caleb Ristvedt <address@hidden> skribis:

> I'd just like to add that if a user has guix installed for root but only
> really keeps their user's guix up to date (I imagine a fairly common
> situation), they're in for a weird situation when using sudo: a
> bleeding-edge guix will complain about being outdated, since sudo (even
> with -E) sets $USER, which is used to determine which file's timestamp
> should be used for deciding whether the installed guix is outdated.
> Basically, your shiny new guix warns you that someone else's dirty old guix
> is old.

True, that’s super weird!  (Actually I think it’s $HOME, not $USER.)

Currently the ‘xdg-directory’ procedure (and thus ‘config-directory’,
which by default gives ~/.config/guix) does this:

          (or (getenv variable)
              (and=> (or (getenv "HOME")
                         (passwd:dir (getpwuid (getuid))))
                     (cut string-append <> suffix)))

I think giving $HOME higher precedence than /etc/passwd is the “right”
behavior (the behavior people expect from programs in general), but it’s
true that it’s confusing in this case.

Thoughts?

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]