From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5dhu-0005EF-8y for guix-patches@gnu.org; Mon, 09 Apr 2018 16:48:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5dhr-0005vR-6r for guix-patches@gnu.org; Mon, 09 Apr 2018 16:48:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36407) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f5dhr-0005vE-28 for guix-patches@gnu.org; Mon, 09 Apr 2018 16:48:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f5dhq-0000Ki-EQ for guix-patches@gnu.org; Mon, 09 Apr 2018 16:48:02 -0400 Subject: [bug#31112] Patching the default PATH of `su` Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5dhQ-00058h-Sq for guix-patches@gnu.org; Mon, 09 Apr 2018 16:47:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5dhN-0005lL-QB for guix-patches@gnu.org; Mon, 09 Apr 2018 16:47:36 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:39722) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f5dhN-0005lB-KI for guix-patches@gnu.org; Mon, 09 Apr 2018 16:47:33 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180405163712.GA24811@jasmine.lan> <8737084vbe.fsf@gnu.org> <20180409161712.GA25955@jasmine.lan> Date: Mon, 09 Apr 2018 22:47:30 +0200 In-Reply-To: <20180409161712.GA25955@jasmine.lan> (Leo Famulari's message of "Mon, 9 Apr 2018 12:17:12 -0400") Message-ID: <87d0z8gl99.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Leo Famulari Cc: 31112@debbugs.gnu.org Hey Leo, Leo Famulari skribis: > I've attached a patch that sets the variables in /etc/login.defs. > > The resulting PATH only includes "system" packages, which are found in > /run/current-system and /run/setuid-programs. > > It would be better if it also included the user-specific programs in > ~/.guix-profile, but I don't think this is possible without patching > `su` to look up usernames. > > Shell variables are not expanded by `su`, so using $HOME doesn't work. > And I'm not sure how to use /var/guix/profiles/per-user without making > `su` look up usernames. > > Nevertheless, I think it's an improvement, although maybe it's less > confusing for the PATH to be totally wrong than merely missing the > user's packages. WDYT? I think the patch is an improvement. I don=E2=80=99t see how we could add the user ~/.guix-profile as well, especially since there=E2=80=99s no central place that parses =E2=80=98logi= n.defs=E2=80=99 (Shadow has its own parser in lib/getdef.c). BTW, for a similar reason, OpenSSH=E2=80=99s =E2=80=98scp=E2=80=99 doesn=E2= =80=99t work when the remote machine runs GuixSD, even if OpenSSH is in the user=E2=80=99s profile. > With the attached patch, I tested mingetty and agetty's login, as well > as OpenSSH sshd login, and everything seemed to work =E2=80=94 this chang= es > should have no effect in those cases because it affects non-login shells > only. Great. > AFAICT, `su` doesn't use this. The relevant code is below; it hard-codes > the fall-back PATHs rather than refer to libc. OK. > From dc5098edd98c85ad45d2e22ca1824a9445dcc36d Mon Sep 17 00:00:00 2001 > From: Leo Famulari > Date: Sun, 8 Apr 2018 14:30:05 -0400 > Subject: [PATCH] system: Provide a fall-back PATH for non-login shells st= arted > with su(1). > > * gnu/system.scm (operating-system-etc-service): Provide values for > ENV_PATH and ENV_SUPATH in '/etc/login.defs'. So LGTM, thank you! Ludo=E2=80=99.