guix-devel
[Top][All Lists]
Advanced

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

Re: Patching the default PATH of `su`


From: Ludovic Courtès
Subject: Re: Patching the default PATH of `su`
Date: Fri, 06 Apr 2018 10:01:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

Leo Famulari <address@hidden> 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 <paths.h>:

  /* Default search path. */
  #define       _PATH_DEFPATH   "/usr/bin:/bin"
  /* All standard utilities path. */
  #define       _PATH_STDPATH \
          "/usr/bin:/bin:/usr/sbin:/sbin"

Does ‘su’ rely on this?  In a future rebuild cycle we could change these
values, but /run/current-system/bin wouldn’t work on foreign distros, so
it’s not clear there’s much to gain.

Thanks,
Ludo’.



reply via email to

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