From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Re: =?utf-8?Q?=E2=80=98sudo=E2=80=99?= leaves PATH =?utf-8?Q?unch?= =?utf-8?Q?anged=E2=80=A6?= so what? Date: Sun, 20 Jan 2019 03:12:33 +0100 Message-ID: <20190120031233.70952be6@scratchpost.org> References: <87y37jwp1p.fsf@gnu.org> <87h8e7h6yd.fsf@elephly.net> <87r2dbv4w0.fsf@gnu.org> <87zhryv3l5.fsf@roquette.mug.biscuolo.net> <87fttqfmnm.fsf@elephly.net> <8736poqmyc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/xmfrejtECdv+GVn2NbMfDto"; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:52873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gl2bR-0007ma-2W for guix-devel@gnu.org; Sat, 19 Jan 2019 21:12:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gl2bP-0007zB-7Q for guix-devel@gnu.org; Sat, 19 Jan 2019 21:12:49 -0500 In-Reply-To: <8736poqmyc.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Cc: guix-devel@gnu.org --Sig_/xmfrejtECdv+GVn2NbMfDto Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludo, On Sat, 19 Jan 2019 23:52:59 +0100 Ludovic Court=C3=A8s wrote: > Currently the =E2=80=98xdg-directory=E2=80=99 procedure (and thus =E2=80= =98config-directory=E2=80=99, > which by default gives ~/.config/guix) does this: >=20 > (or (getenv variable) > (and=3D> (or (getenv "HOME") =20 > (passwd:dir (getpwuid (getuid)))) > (cut string-append <> suffix))) >=20 > I think giving $HOME higher precedence than /etc/passwd is the =E2=80=9Cr= ight=E2=80=9D > behavior (the behavior people expect from programs in general), but it=E2= =80=99s > true that it=E2=80=99s confusing in this case. I think it's good that one can override defaults using environment variable= s. But if it was this instead: > (or (getenv variable) > (and=3D> (cond=20 ((getenv "SUDO_USER") (passwd:dir (getpwnam (getenv= "SUDO_USER")))) ((getenv "HOME") (getenv "HOME")) (_ (passwd:dir (getpwuid (getuid))))) > (cut string-append <> suffix))) ... it would be still overridable by the user (by unsetting SUDO_USER and setting HOME), so it would be fine. (sudo without "-E" also nukes XDG_CONFIG_HOME, so it's ok if that gets pref= erred if it's there) Or we could just document "sudo -E" in the documentation and do nothing. I have a slight preference for the latter since it's less magical. But from a user experience standpoint the former does what is probably expected. --Sig_/xmfrejtECdv+GVn2NbMfDto Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlxD2REACgkQ5xo1VCww uqWGGAgAkZB4wHvtls6FOzgDGw1nGS+X4imdeIBkZ+JY8xQtsUj+/r8XaZQJ8VRL G0ToaaXrbFrWhBAiFJtKCUUQNbpa41JFuPokHf4SLiuBQHtOthPPtrixhvXH9Ebx AWxDV8dIa20PCFiJV/74xPVb0IZzfzVwKvYWv4EvlTkNA6QkY1T79AbUP97laMWx 3g1vBrRvmYBkCNGAowg+FQMTCQKywdEDK3da71ORFvFFpb+4yZN9EISZcMeFVuol K35We9iu+iamkp9Vc0DTnw9TTYuMrDHFEt56MAxIdwuhfgRuXSvpmWKhj5JWEomj XGgAcED+Jmo3/J4lPyXrUoKxzlrpHw== =9yl3 -----END PGP SIGNATURE----- --Sig_/xmfrejtECdv+GVn2NbMfDto--