From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Patching the default PATH of `su` Date: Fri, 06 Apr 2018 10:01:57 +0200 Message-ID: <8737084vbe.fsf@gnu.org> References: <20180405163712.GA24811@jasmine.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4MJv-0007hU-Ta for guix-devel@gnu.org; Fri, 06 Apr 2018 04:02:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4MJs-0003rN-PR for guix-devel@gnu.org; Fri, 06 Apr 2018 04:02:03 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:37980) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4MJs-0003r8-JN for guix-devel@gnu.org; Fri, 06 Apr 2018 04:02:00 -0400 In-Reply-To: <20180405163712.GA24811@jasmine.lan> (Leo Famulari's message of "Thu, 5 Apr 2018 12:37:12 -0400") 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: Leo Famulari Cc: guix-devel@gnu.org Hello, Leo Famulari skribis: > In the man page of su(1), it says this: > > ------ > The current environment is passed to the new shell. The value of $PATH is= reset to > /bin:/usr/bin for normal users, or /sbin:/bin:/usr/sbin:/usr/bin for the = superuser. > This may be changed with the ENV_PATH and ENV_SUPATH definitions in /etc/= login.defs. > ------ > > This means that `su leo` or `sudo su` give a broken environment on > GuixSD. You have to use `su --login` instead. > > Should we use our own values for ENV_PATH and ENV_SUPATH so that this > works out of the box? Probably, yes. It would be good to check how this affects mingetty/login, sshd, etc. Note that libc also has its own default PATH value in : /* Default search path. */ #define _PATH_DEFPATH "/usr/bin:/bin" /* All standard utilities path. */ #define _PATH_STDPATH \ "/usr/bin:/bin:/usr/sbin:/sbin" Does =E2=80=98su=E2=80=99 rely on this? In a future rebuild cycle we could= change these values, but /run/current-system/bin wouldn=E2=80=99t work on foreign distro= s, so it=E2=80=99s not clear there=E2=80=99s much to gain. Thanks, Ludo=E2=80=99.