* Patching the default PATH of `su`
@ 2018-04-05 16:37 Leo Famulari
2018-04-06 8:01 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Leo Famulari @ 2018-04-05 16:37 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 514 bytes --]
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?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Patching the default PATH of `su`
2018-04-05 16:37 Patching the default PATH of `su` Leo Famulari
@ 2018-04-06 8:01 ` Ludovic Courtès
2018-04-06 12:39 ` Leo Famulari
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2018-04-06 8:01 UTC (permalink / raw)
To: Leo Famulari; +Cc: guix-devel
Hello,
Leo Famulari <leo@famulari.name> 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’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Patching the default PATH of `su`
2018-04-06 8:01 ` Ludovic Courtès
@ 2018-04-06 12:39 ` Leo Famulari
0 siblings, 0 replies; 3+ messages in thread
From: Leo Famulari @ 2018-04-06 12:39 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 911 bytes --]
On Fri, Apr 06, 2018 at 10:01:57AM +0200, Ludovic Courtès wrote:
> Probably, yes. It would be good to check how this affects
> mingetty/login, sshd, etc.
Okay. I can test the change.
> 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.
I don't think `su` uses this, but I'll find out. As you say, it wouldn't
help much on foreign distros. I think the situation with `su` is
different, since it seems inconvenient to use our `su` on a foreign
distro, because it needs to be setuid.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-06 12:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05 16:37 Patching the default PATH of `su` Leo Famulari
2018-04-06 8:01 ` Ludovic Courtès
2018-04-06 12:39 ` Leo Famulari
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).